Forum Stats

  • 3,873,717 Users
  • 2,266,632 Discussions


Can't run my Web Site app that used to work in .Net 4.0

user10703969 Member Posts: 11
edited Oct 22, 2015 4:42PM in Downloads Issues

I had a web site that worked.  It used .Net 2.x.  Lately I had to look at that code again.  I migrated it to 4.0.  I used ODAC 12 Oracle.DataAccess.dll.  I'm having various problems and my actual server is only 11g.  The customer I was trying to help found that by installing some version 11 ODAC files, it worked for her.

So I went to the Oracle ODAC download site.  I downloaded this:

Download the Oracle Universal Installer version           [Released December 28, 2010] 227 MB (238,256,403 bytes)
Installation Instructions

Download Includes

Oracle Data Provider for .NET 4
Oracle Data Provider for .NET 2.0
Oracle Providers for ASP.NET 4
Oracle Providers for ASP.NET 2.0
Oracle Database Extensions for .NET 4 -- for upgrade only
Oracle Database Extensions for .NET 2.0 -- for upgrade only
Oracle Provider for OLE DB
Oracle Objects for OLE
Oracle Services for Microsoft Transaction Server
Oracle ODBC Driver
Oracle SQL*Plus
Oracle Instant Client

   Ah, there is the .Net 4 stuff, I thought.  So I transferred the downloaded file to my Win7 development box.  Ran the setup and install.  Guess what?  It only shows options for installing .Net 2.0 stuff.

What is going on?  Where should I get some 11 g drivers that work with .Net 4?


  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 3,153 Employee
    edited Oct 21, 2015 4:29PM

    For ODP.NET, the installer actually shows .NET version neutral installation options. You can choose to install all of ODP.NET (including .NET 2 and 4 versions), but the installer won't let you choose only ODP.NET for .NET 2 or ODP.NET for .NET 4. The only reason the installer wouldn't install/configure one, but not the other is if you only had .NET 2 or only .NET 4 set up on the target machine.

  • user10703969
    user10703969 Member Posts: 11
    edited Oct 22, 2015 10:07AM

    Apparently not true, because I have .net versions 2.x, 3.0, 3.5, and 4.x installed.

  • user10703969
    user10703969 Member Posts: 11
    edited Oct 22, 2015 12:04PM

    Ok, I finally got something downloaded that worked.  Apparently, even though I wanted 32 bit provider, I had to get a 64 bit download because the machine is 64 bit.

    The version 12 provider seems to be able to connect to the server version 9 ok.

  • user10703969
    user10703969 Member Posts: 11
    edited Oct 22, 2015 12:09PM

    Oh, no, although I could connect with a 32 bit UDL, now I am trying to use the Oracle.DataAccess.dll in my Visual Studio Silverlight project.  I have a service that is to make the database calls.

    I've created a .Net 4 class library project and when I add the Oracle dll, I get:

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "Oracle.DataAccess", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

    Where the heck is AMD64 coming from?

    Now what?

  • user10703969
    user10703969 Member Posts: 11
    edited Oct 22, 2015 2:50PM

    I'm not sure of the consequence of the AMD64, but I was able to run my .Net 4 app and access the database with it.

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 3,153 Employee
    edited Oct 22, 2015 4:42PM

    The problem you are encountering is that you've installed both an Oracle 32-bit and 64-bit client on the same machine. When you try to use 32-bit ODP.NET, it looks for its dependent Oracle Client DLLs in the Windows Path. If it finds the 64-bit Oracle Client DLLs first, then it will try to use them, which doesn't work.

    In ODP.NET, there is a .NET config setting called DllPath. It allows you to tell ODP.NET where to find its dependent Oracle Client DLLs. You can set it to the directory location where you installed the Oracle Client Home that has your ODP.NET version.

    IMO, a simpler solution for you, since you are using .NET 4, is to use the managed ODP.NET version. Instead of using Oracle.DataAccess.dll, use Oracle.ManagedDataAccess.dll. Both these DLLs are part of the ODP.NET 12c. This problem doesn't exist in managed ODP.NET because it is 100% managed code.

This discussion has been closed.