更改为x64平台时无法加载程序集错误 [英] Could not load assembly error when changing to x64 platform
问题描述
我刚刚创建了一个新的asp.net 3.5 Web应用程序。我转到应用程序属性,并将平台目标更改为x64。我没有写任何代码,也没有做任何更改。接下来,我点击在Visual Studio中开始调试。发生以下错误:
I have just created a new asp.net 3.5 web application. I went to the application property and changed the platform target to x64. I didn't write any code and i have not changed anything. Next i hit start debugging in Visual Studio. The following error occured:
无法加载文件或程序集
解决方案名称,版本= 1.0.0.0,
Culture = neutral,PublicKeyToken = null'
或其依赖项之一。尝试
加载格式错误的
程序。
Could not load file or assembly "SOLUTION NAME", 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.
任何人都知道如何解决这个问题?
谢谢。
Any one have an idea how to solve this?
Thanks.
编辑:
我有以下警告:
I have these warnings:
警告1程序集生成-
引用的程序集
'System.EnterpriseServices.dll'
瞄准了不同的处理器
警告2程序集生成-
引用的程序集'mscorlib.dll'
指向其他处理器
警告3程序集生成-
引用的程序集'System.Web.dll'
针对另一个处理器
警告4程序集生成-
引用程序集'System.Data.dll'
针对另一个处理器
Warning 1 Assembly generation -- Referenced assembly 'System.EnterpriseServices.dll' targets a different processor
Warning 2 Assembly generation -- Referenced assembly 'mscorlib.dll' targets a different processor
Warning 3 Assembly generation -- Referenced assembly 'System.Web.dll' targets a different processor
Warning 4 Assembly generation -- Referenced assembly 'System.Data.dll' targets a different processor
配置管理器:
推荐答案
我发现了问题。
似乎Visual Studio和Cassini作为32位应用程序运行。如果我尝试使用Microsoft的Cassini托管我的64位ASP.NET应用程序,则会出现异常。
It seems that Visual Studio and Cassini run as 32-bit applications. If i try to host my 64-bit ASP.NET application using Microsoft's Cassini, i will get an exception.
所以我在IIS上部署了我的解决方案,将其更改为64位,对其进行了调试,一切正常。
So i deployed my solution on IIS, changed it to 64-bit, debugged it and every thing is working perfectly.
这篇关于更改为x64平台时无法加载程序集错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!