0

So I'm having a problem publishing my WebApp. I have set all the projects to AnyCPU in Configuration Manager. I was using a 32 bit version of Oracle.DataAccess.dll in my DAL but I need to use a 64 bit version for the server. The server is running a 64 bit version of Oracle.

Unfortunately when I put the 64 bit version of the dll in my project and rebuild it throws an error.

Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Any ideas would be greatly appreciated. I have been working on this one problem for a few days now and haven't been able to find help.

Oh also! I could actually publish before and it push the 32 bit version of the Oracle dll even though I had the 64 bit version in my DAL. I ended up removing the 32 bit version of Oracle off my computer so that wouldn't happen. But any ideas why it did that?

2 Answers 2

1

The fix from brandonbanks worked until installing oracle client 12c r2 (64bit). After install Visual Studio would not load oracle data access dll (same error as listed).

Previous oracle client was 12c r1 (64bit) but I needed oracle client r2. The new r2 oracle client broke ability to build asp.net project in visual studio.

The fix was to uninstall all oracle, followed by full clean (remove oracle from registry plus left behind oracle files). Then compile worked fine. Didn't need to change anything Visual studio side. Also didn't need to reinstall oracle Client for compile and publish to start working again (just need the 12c r2 oracle 64 bit data access dll).

Can then reinstall other oracle clients but if also installing 32bit client suggest doing 64bit client last.

0

Found out it was a problem with the compiling process in Visual Studio.

I added this line to the publish profile in the App_Data folder.

<AspnetCompilerPath>C:\Windows\Microsoft.NET\Framework64\v4.0.30319</AspnetCompilerPath>

Also had to change my IIS to 64 bit. I used this cmd script.

reg add HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\WebProjects /v Use64BitIISExpress /t REG_DWORD /d 1

Hope this helps anyone out there who has a similar problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.