Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
SQL
I have a website project in my .NET 4.0 solution. It has a reference to a 64 Bit dll. I am able to build / compile it from the command prompt. However, the build from Visual Studio fails with a bad image format exception, since Visual Studio by default uses the 32 Bit version of the compiler when compiling a website.

I tried setting the Toolpath property of the ASPNETCompiler task in the solution file, but Visual Studio does not seem to pick that up.

Is there a way to configure Visual Studio to use 64 Bit Compiler while compiling a website?
Posted

1 solution

Yes. In your project properties there is a platform setting which can be set to 32bit, 64bit or Any. You should be able to set this to force 64bit compilation.

How to: Configure Projects to Target Platforms[^]
 
Share this answer
 
Comments
Angshuman1977 7-Jun-13 0:17am    
Stephen, thanks for your response. However, my project which I am trying to build in 64 Bit is a "website" and hence, it does not have any option to select a platform, other than "Any CPU". That is where the problem is. If I convert the website into a web application, I can set the platform to x64 and work without any problem.
zairja 19-Mar-20 21:48pm    
Did you solve this?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900