简体   繁体   English

IIS将4.5.1 Web应用程序发布到应用程序池4.0

[英]IIS publish 4.5.1 web application to application pool 4.0

I am trying to run an website that I have hosted an IIS server using localhost, however, the MVC 5 project I have created uses .NET 4.5.1 and in IIS App pool I have selected v4.0 - Is this right? 我正在尝试运行一个使用localhost托管IIS服务器的网站,但是,我创建的MVC 5项目使用.NET 4.5.1,并且在IIS应用程序池中我选择了v4.0-是这样吗?

The reason why I have asked is when I browse to the site, I get this error 我问的原因是当我浏览该站点时,出现此错误

Server Error in '/' Application. “ /”应用程序中的服务器错误。

Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. 无法加载文件或程序集'Microsoft.Web.Infrastructure,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'或其依赖项之一。 The system cannot find the file specified. 该系统找不到指定的文件。

I realise this is a reference problem but I have a feeling its to do with IIS and the app pool. 我意识到这是一个参考问题,但与IIS和应用程序池有关。

Any ideas? 有任何想法吗?

Please note I am deploying the site onto a different server 请注意,我正在将该站点部署到其他服务器上

Thanks 谢谢

OK, found the answer, 好,找到答案了

Even though the Microsoft.Web.Infrastucture is referenced in the project (if not, get it using NuGet) you need to change CopyLocal to equal true when you click on the reference. 即使在项目中引用了Microsoft.Web.Infrastucture(如果没有引用,请使用NuGet进行获取),您也需要在单击引用时将CopyLocal更改为true Do this when deploying onto a server when Visual Studio isn't installed 在未安装Visual Studio的情况下部署到服务器上时执行此操作

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

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