0

In Visual Studio 2010, My client is requiring me to target the mvc 2 web application to x64 since it would be running on a virtual server. I have three projects in my solution

Previously the settings were

Domain
Configuration: Active Debug, Platform Active x86
Platform: Any CPU

Pdf

Configuration: Active Debug Platform Any CPU
Platform: Any CPU

WebUI

Configuration: Active Debug Platform Active x86
Platform: Any CPU

I changed the Platform to x86 in all three projects and solution configuration as well and when I try to run the web UI application locally on my dev machine, I get the following error

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

I checked in the Domain Project refrences and the only third part DLL I have is Dapper and I don't think DLL is causing the issue, rest of the dlls referenced in this project are Entity framework, and other Microsoft dlls. I do not have IIS installed on my machine so there isn't any other setting which is wrong. Any ideas?

tam tam
  • 1,870
  • 2
  • 21
  • 46
  • Dev server that comes with VS 2010 is 32 bit only... You need later one or full IIS for x64 assemblies. – Alexei Levenkov Oct 17 '15 at 03:09
  • @AlexeiLevenkov on a different development machine I have VS 2012 with MVC3. So you are saying in VS2012, if I change project solution to target x64, I should be able to run it locally on the machine? – tam tam Oct 17 '15 at 03:14
  • @AlexeiLevenkov , I have the same project in Visual Studio 2012 in a different machine. Its MVC3. I converted this one to x64, I cant even run the application locally on this machine and I get the same error with the Domain.DLL – tam tam Oct 17 '15 at 03:19
  • http://stackoverflow.com/questions/15596085/how-do-i-test-running-my-asp-net-web-app-as-a-64-bit-process-on-a-development-se (Note that it may not be the only problem - you need all references to be compatible with x64, but at least getting server that can run x64 is a good start). – Alexei Levenkov Oct 17 '15 at 03:20
  • I installed IIS on the development machine with Visual Studio 2010, In the application pool made sure it lets x64 apps, I am still get the could not load file or assembly 'Domain' or one of its dependencies. – tam tam Oct 17 '15 at 05:07
  • Also all the DLLs within the domain project are x86? Do I need to convert every DLL referenced to x64? – tam tam Oct 17 '15 at 05:33
  • Pure managed DLLs can be x64 or AnyCPU, native DLL/interop must match process bitness and hence have to be x64. Usually you'd find separate x86/x64 versions of of native/interop DLLs. – Alexei Levenkov Oct 17 '15 at 07:35
  • I got it working in the machine which has VS 2010. I had to disable anonymous authentication and turn on windows authentication in IIS. My app in X64 works great. I still have to figure out to make it work in VS 2012 , maybe some small setting. Thanks for pointing out that I had to use IIS. you can post an answer and I shall accept it. – tam tam Oct 17 '15 at 09:09

0 Answers0