Search code examples
oracle-databaseentity-frameworkvisual-studio-2012odac

What do I need to install or configure into deployment machine to run an Entitity Framework with Oracle console application ?


I did a whole development under Windows 7 + VS 2012 using Entity Framework 4.1

My application is a Windows Console application that uses Entity Framework to access an Oracle database that runs in a remote server. My application has a x64 target setting, and my Windows 7 is also 64bit.

All went fine on development machine until I started deployment to a production host.

Production host: Newly installed Windows Server 2012. Installed ODAC 64-bit and run configure.bat at odp.net/managed/x64 folder.

I´m taking all files from my application genereated at /bin/Debug folder form VS2012 and copying to the target machine, together with Oracle.DataAccess.dll.

My connection string has providername = System.Data.EntityClient. This was generated by EF Model-First Wizard.

When running, I´m getting the following exception:

Unable to find the requested .NET Framework Data Provider. It may not be installed. at System.Data.EntityClient.EntityConnection.GetFactory (String providerString).

I´ve checked the ODCA configure.bat and it installs OracleManageDataAccessDTC.DLL

So, I´m very confused. I have Oracle.DataAcess.dll, OracleManageDataAccessDTC.dll and none of this work. This is my first Oracle deployment with EF 4.1.

I had a look on many posts and got no conclusion about that at all.

Hope someone can help me.


Solution

  • ODAC is a pain to get working on a server. There a bunch of things you need to consider:

    1. You have to install the Oracle client on the server
    2. If you are using the TNS name file, you need to have that in the network folder
    3. You actually are not using the oracle dll that is in your bin folder, that dll requires a bunch of other dependent dlls that are on the server when you install the client and ODAC.