简体   繁体   English

Visual Studio 2010使用错误的框架进行构建

[英]Visual Studio 2010 build with wrong framework

I'm working on Visual Studio Profesionnal 2010. 我正在研究Visual Studio Profesionnal 2010。

In my solution I've got 2 projects The first is a web site with targeted .net runtime 2.0 the second is a dll with targeted .net runtime 2.0 I add the output of the second as assembly of the first. 在我的解决方案中,我有2个项目,第一个是目标为.net runtime 2.0的网站,第二个是目标为.net runtime 2.0的dll,我将第二个的输出添加为第一个的汇编。

I build and rebuild and clean my solution result : Build succeeded 我构建并重建并清理解决方案结果:构建成功

But when I launch the projet in my web-browser ( in debug or release ). 但是,当我在Web浏览器中启动projet时(在debug或release中)。 I've got the Server Error : 我收到服务器错误消息:

This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded 该程序集由比当前加载的运行时新的运行时构建,无法加载

Is there someone who had already the problem? 有人已经有问题了吗?

I think it can be a bug from Visual Studio 2010 but the hotline is very expensive 300€ the phone call. 我认为这可能是Visual Studio 2010的一个错误,但热线电话非常昂贵,只需300欧元。

More Information : I opended my dll with reflector and saw that mscorlib is referenced 2 times the first time Version = 2.0 and the second time version = 4.0 更多信息: 我用反射器打开了dll,发现第一次版本= 2.0和第二次版本= 4.0引用了mscorlib 2次

I am pretty sure that this means that you built with asp.net framework 3.5x, but your server only has 3.0x. 我非常确定这意味着您使用asp.net Framework 3.5x构建,但是您的服务器只有3.0x。 Update the runtime on the server. 更新服务器上的运行时。

Open the .csproj file with text editor (eg Notepad) and see the references in there. 使用文本编辑器(例如记事本)打开.csproj文件,然后在其中查看参考。

If there are references to frameworks higher than 2.0 remove them or change to 2.0 if possible, save and reload the project. 如果有对高于2.0的框架的引用,请删除它们或尽可能将其更改为2.0,保存并重新加载项目。

您的服务器仅支持3.0,更新服务器将解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM