How to Make ODP.NET 4.0 (64 bit) working on 64 bit machine Windows 7?

后端 未结 2 1756
南笙
南笙 2021-02-11 05:28

I have installed the Oracle Client for the 64 bit machine using the XCopy 11.2 provided by Oracle (Installed everything as per the read me instructions).

I am using Visu

相关标签:
2条回答
  • 2021-02-11 05:38

    You must install 64-bit Oracle Data Access Components (ODAC) since the Oracle Client Installation doesn't register Oracle.DataAccess.dll into the assembly.

    If your oracle data access installation is OK, everything should work after unchecking "Enable 32 bit applications" in your Application Pool settings.

    If you still have the same error, it is possible that you have a 32 bit dll in your bin folder of the website. Just delete it and the website will use the 64 bit from the assembly and it should work.

    0 讨论(0)
  • 2021-02-11 05:57

    The best possibility to handle this is to use the x86 version locally with Visual Studio and x64 version on the server with IIS. To do this you have to download both versions - copy one in folder lib\x86 and the other in lib\x64 After this you have to modify the project file(s) - visual studio supports conditional references. Add following section to your project file:

    <PropertyGroup>
         <ReferencesPath Condition=" '$(Platform)' == 'x86' ">..\Lib\x86</ReferencesPath>
         <ReferencesPath Condition=" '$(Platform)' == 'x64' ">..\Lib\x64</ReferencesPath>
    </PropertyGroup>
    

    After this reference the odp.net assmebly like this:

    <Reference ... processorArchitecture=$(Platform)">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>$(ReferencesPath)\Oracle.DataAccess.dll</HintPath>
       <Private>True</Private>
    </Reference>
    

    This way when you can build locally as x86 and on the server x64 and always the correct version of Oracle.DataAccess.dll will be referenced.

    Alternatively if you only want to use the x64 version than you have to stick to IIS even you work locally OR you could try to run the open source version of Cassini in x64 mode (http://cassinidev.codeplex.com).

    For me the best possibility is to reference both versions as described above - this has been working fine for everyone on my team for a while now.

    0 讨论(0)
提交回复
热议问题