System.IO.FileLoadException运行Web应用程序时

编程入门 行业动态 更新时间:2024-10-27 21:12:33
本文介绍了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应用程序时

本文发布于:2023-11-14 14:14:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1587434.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   IO   System   Web   FileLoadException

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!