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

StackOverflow https://stackoverflow.com/questions/18321331

문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

No idea if this will help but..

I found your post before realizing that the app I was building needed 2 connection strings, one for my WebSecurity / WebMatrix.Data model & one for my Entity Framework model.

I had built the project locally & all was working well. Once I updated the connection strings to a remote server, I got the same error as you until realizing that the WebMatrix.Data model needed to use the System.Data.SqlClient provider & not the System.Data.EntityClient provider.

IF its truly an ORacle issue, this post may help you --> Could not load file or assembly 'Oracle.DataAccess error

Installing the 32bit ODAC drivers on the server, as well as building the app x86 corrected the problem for me.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top