GAC 中出现重复的 System.Web!

发布于 2024-08-01 14:19:06 字数 430 浏览 1 评论 0原文

我正在尝试将 asp .net MVC 应用程序部署到 II7 上,并收到以下错误:

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

服务器有 .net 3.5 SP1,我尝试将 dll 包含在网站 bin 中,但没有成功!

我注意到在服务器上的 GAC 中有 2 个 System.Web 2.0,一个具有 x86 处理器架构,另一个具有 AMD64(服务器是 Intel XEON),这是否会导致此错误?

谢谢

解决方案:将构建平台目标更改为 x64,哦!

I am trying to deploy an asp .net MVC app onto II7 and getting the following error:

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

The server has .net 3.5 SP1 and I tried including the dll in the website bin with no luck!

I noticed in the GAC on the server there are 2 System.Web 2.0 one with the processor architecture x86 and another with AMD64 (server is Intel XEON), could this be causing this error?

Thanks

SOLUTION: Change the build platform target to x64, doh!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

著墨染雨君画夕 2024-08-08 14:19:06

GAC 中应该有两名成员。 一种是 32 位,另一种是 64 位。 从错误来看,您正在尝试将 64 位 dll 加载到 32 位进程中。 程序编译成多少位数? 服务器操作系统是多少位?

There are supposed to be two in the GAC. One is 32 bit and the other is 64 bit. It sounds, from the error, that you are trying to load a 64-bit dll into a 32-bit process. What bitness is the program compiled as? What bitness is the server OS?

债姬 2024-08-08 14:19:06

在 x64 IIS7 上遇到同样的错误。
我将应用程序池设置“启用 32 位应用程序”更改为 true。

Got the same error on a x64 IIS7.
I changed the Application Pool setting "Enable 32-Bit Applications" to true.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文