0
votes

I am using Visual Studio 2012 and 64bit Oracle client installed on my computer(x64). I have added Oracle.DataAccess dll to my project references and getting this warning: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "ProjectName, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64", "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.

My project is a WebService project and Configuration Settings is ANYCPU. When I run the project and webservice is hosted on localhost, error page is shown as BadImageFormatException. I also tried to run the project on x86 and x64 settings.

How can I solve this problem? Is there any difference between IIS and IIS Express? When I hit the F5 button and run the project, is localhost running on IIS express?

1

1 Answers

0
votes

BadImageFormatException implies you are trying to load the 64 bit assembly into a 32 bit process. In vs 2012 the default is to launch 32 bit IIS express, as pointed out in this User Voice link:

https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/3254745-allow-for-iis-express-64-bit-to-run-from-visual-st

You can work around this by hosting in IIS and making sure app pool is 64 bit (which is the default)...or get VS 2013. My suggestion is to always run in IIS to match your production environment.