One is the 32-bit and 64-bit versions. If the application we developed is 32-bit, we must use a 32-bit client, if it is a 64-bit application, it certainly corresponds to a 64-bit client. Note: in a 64-bit environment, use the vsdevelopment Web program. The webservice running webdev.webserver.exe is 32-bit. Therefore, to debug a 64-bit oracle Connection program, you 'd better deploy it in iis and use iis to connect to the oracle database.
Another version issue is oracle. dataaccess version. My local machine is 32-bit xp. After the oracle11gr2 client is installed, the odp under the installation directory is displayed. you can find oracle in the netbin2.x directory. dataaccess. dll file. The version number is 2.112.1.2. So the program I developed references the library of this version.
However, the 64-bit oracle. dataaccess. dll is different. The installed version is 2.112.1.0, as shown in the figure below: oracle. dataaccess. dll on windows2008x64.
Now release and deploy the program in the development environment on the server, and an exception will be thrown.
Failed to load file or assembly "oracle. dataaccess, version = 2.112.1.2, culture = neutral, publickeytoken = 89b483f429c47342" or one of its dependencies.
Or
Cocould not load file or assembly 'Oracle. dataaccess, version = 2.112.1.2, culture = neutral, publickeytoken = 89b483f429c47342 'or one of its dependencies. an attempt was made to load a program with an incorrect format.
In short, the corresponding assembly cannot be found. Apparently, the system is looking for oracle 2.112.1.2. dataaccess, and only version 2.112.1.0 on the server, so the error is reported. The solution is in the web. after the configsections node ends, add the following content:
<Runtime>
<Assemblybinding xmlns = "urn: schemas-microsoft-com: asm. v1">
<Dependentassembly>
<Assemblyidentity name = "oracle. dataaccess"
Publickeytoken = "89b483f429c47342"
Culture = "neutral"/>
<Bindingredirect
Oldversion = "2.112.1.2"
Newversion = "2.112.1.0"/>
</Dependentassembly>
</Assemblybinding>
</Runtime>
In this way, iis can call oracle. dataaccess of 2.112.1.0. After this configuration is added, it can run normally.