3

I have an ASP.NET Web Forms app that I am building and running against .NET 4.0 on a Win7 local machine. (All is OK on local box.) My app is running EF4.1 against an Oracle DB, so I am using the Oracle EF data provider, which is still in Beta.

Right now, I can successfully deploy the app to my Win2008 Server target machine using Web Deploy from my local VS2010, but when I run the app on the target, I get the classic Unable to find the requested .Net Framework Data Provider error.

Here's my (unsuccessful) setup, as of now:

  • 32-bit applications are enabled in the app pool (.NET 4.0) on the Win2008 Server target.

  • Copy Local is set to true for the Oracle.DataAccess DLL in my local VS2010 solution.

  • Both of the Platform and Platform target settings are set to Any CPU in my local Build Configuration. (I have tried different settings here without success.)

  • The Win2008 Server target does not have an Oracle.DataAccess DLL in the GAC. (I thought that setting Copy Local on the Oracle DLL would mean that I didn't need the GAC.)

EDIT: I have tried to GAC the Oracle.DataAccess DLL, but I get the same error that is discussed here. (I still have to investigate this.) Also, there is already another Oracle client on my target box, and installing the Oracle client that comes with the Oracle EF data provider seems to interfere with it. This cannot be allowed to happen.

Question 1: What combination of build configuration settings (on the local box) and IIS settings (on the target) do I need to select in order to be able to run my app on the 2008 Server?

Question 2: How can I get this to work without installing another Oracle client on my target server?

Thanks again for the help.

Update: All is working. See my answer below for a link to the full solution, as well as links to helpful information.

Community
  • 1
  • 1
bflow1
  • 969
  • 1
  • 10
  • 25

2 Answers2

2

Since your server doesn't have Oracle.DataAccess in the GAC, that indicates that you haven't installed the Oracle client on that machine and are trying to make it work by deploying Oracle.DataAccess.dll as part of your app.

I'm not quite sure exactly what needs to be installed on the server. I usually just run the Oracle setup on the server to ensure that all the necessary Oracle files and settings get installed. If you do that, you don't need to deploy Oracle.DataAccess.dll along with your app, it will already be in the server's GAC.

One thing I do know is needed is a config setting that tells the system how to create a new instance of the provider. You can try to add that setting to your web.config and try if that is enough, but again, there may be a lot of dependent DLLs and settings you need for the Oracle provider to work.

The setting is (this is for another version of ODP.Net, you will find the correct settings in machine.config on your own machine):

<system.data>
  <DbProviderFactories>
     <add name="Oracle Data Provider for .NET" invariant="Oracle.DataAccess.Client"
          description="Oracle Data Provider for .NET" type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=4.112.1.2, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</DbProviderFactories>
</system.data>
GTG
  • 4,914
  • 2
  • 23
  • 27
  • I will double-check, but I believe I have a machine.config entry for the Oracle data provider. Is this setting necessary if you have not GAC'ed the Oracle DLL? – bflow1 Nov 29 '11 at 16:44
  • If you have not GAC'ed the DLL you need this in your web.config. The Oracle setup will put this in machine.config and then you don't need it in web.config – GTG Nov 29 '11 at 16:55
  • This could be the whole problem, then. I didn't GAC the DLL, and I have a machine.config entry, but **not** a web.config entry. Thanks a lot for that tip. I'll mark your answer, once I try it out successfully. – bflow1 Nov 29 '11 at 17:06
  • Looks like I am going to need more than what is suggested here, although part of your answer is part of the solution. I'll post a full solution when I get it all working. – bflow1 Dec 02 '11 at 14:01
  • As I mentioned before, I usually use Oracle setup to deploy the ODP.Net provider to the server. Oracle also provides a xcopy installer. You will probably save yourself a lot of time and trouble if you can use the Oracle provided install. – GTG Dec 03 '11 at 20:26
  • I agree that it would be simpler to just run the installer, but I can't always do that when deploying to a client's own server. I need a totally unobtrusive solution. – bflow1 Dec 13 '11 at 22:26
1

GTG's solution provides at least part of the answer to my Question 1, so I am upvoting his solution. For anyone else interested in my Question 2 (how to perform an unobtrusive ODAC installation), an answer can be found here. (Look for AnthonyVO's answer, as it encapsulates all the necessary information.)

I should mention that I have not yet been able to get the unobtrusive solution to work for me, but many have, and it is the solution that I need to implement.

UPDATE: Case closed. I was missing an Oracle DLL. My full setup is shown here.

Community
  • 1
  • 1
bflow1
  • 969
  • 1
  • 10
  • 25