System.IO.FileLoadException运行Web应用程序时 [英] System.IO.FileLoadException When running Web application

查看:73
本文介绍了System.IO.FileLoadException运行Web应用程序时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在构建一个ASP.NET 4应用程序。



我有一个名为CommupointServiceLibrary的DLL。每次我尝试运行Web应用程序时,都会收到以下错误消息。



无法加载文件或程序集''CommupointServicesLibrary,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = e3a9262f077d766f''或其依赖项之一。定位的程序集的清单定义与程序集引用不匹配。 (HRESULT异常:0x80131040)。



dll是.NET 3.5



我在做什么错误?

I am currently building a ASP.NET 4 application.

I have a DLL called CommupointServiceLibrary. Each time that I try to run the web application I get the following error message.

Could not load file or assembly ''CommupointServicesLibrary, Version=4.0.0.0, Culture=neutral, PublicKeyToken=e3a9262f077d766f'' or one of its dependencies. The located assembly''s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).

The dll is .NET 3.5

What I am doing wrong?

推荐答案

服务器使用.Net版本4,因此尝试加载为.Net 4构建的dll。

在Windows应用程序中,您将在< configuration>< / configuration> 部分添加到app.config:

The server uses .Net version 4 and thus tries to load dlls built for .Net 4.
In Windows applications, you''d add to app.config in the <configuration></configuration> section:
<startup useLegacyV2RuntimeActivationPolicy="true">
</startup>



Web应用程序应该有类似内容。


There should be something similar for web applications.


这篇关于System.IO.FileLoadException运行Web应用程序时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆