Click here to Skip to main content
15,889,992 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I have a solution file in Visual Studio 2008 with 1 ASP.NET project and 2 other projects. The ASP.NET project references the other 2 projects.

The other 2 projects were recently changed to build as x64. The ASP.NET project was changed to x64. The computer in question is a Windows 7 64 bit machine.

When I run the ASP.NET project in Visual Studio as debug, I get compilation errors. The error say:

<pre>'Could not load file or assembly &#39;ClientPage, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null&#39; or one of its dependencies. An attempt was made to load a program with an incorrect format.'

[BadImageFormatException: Could not load file or assembly 'ClientPage, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.]</pre>

I was able to debug this project as 'Any CPU'. Why am I not able to run it as x64. My PC is x64.

All my other projects in the same solution were set to 64 bit and I can execute them indedependently (as startup projects) without any problems.
Posted
Updated 26-Feb-11 4:31am
v2

Is the ClientPage Assembly compiled in 64bit? If your solution is referencing a 32bit version, you will get this error.
 
Share this answer
 
Comments
[no name] 23-Feb-11 19:47pm    
All my other projects in the same solution were set to 64 bit and I can execute them indedependently (as startup projects) without any problems.

When you say ClientPage assembly what do you mean?

The ClientPage is the ASP.NET project and it is set to 64 bit in Build options and also in Configuration Manager. So are all other projects.
set the validateRequest attribute of the Page directive to false:
<%@ Page validateRequest="false" %> 

For all applications on your server
<configuration> <system.web> <pages validateRequest="false" /> </system.web> </configuration>


For more information regarding this you can navigate here

If i misunderstand your question, please feel free to correct me.I hope the above information will be helpful. If you have more concerns, please let me know.
If this would be really helpful to you then don't forgot to Vote and Make Answer as Accepted.
 
Share this answer
 
v2
Comments
[no name] 27-Feb-11 19:00pm    
I didnt try it yet..but what does this have to do with 64 bit project or 32 bit project.

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