无法加载文件或程序集“System.Web.Http.WebHost” [英] Could not load file or assembly 'System.Web.Http.WebHost'

查看:1032
本文介绍了无法加载文件或程序集“System.Web.Http.WebHost”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

部署一个MVC网页,我的IIS后,我收到以下错误:

After deploying an MVC webpage to my IIS i get the following error:

Could not load file or assembly 'System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. 

我已经做了prevent这个问题上的以下变化:

I've done the following changes to prevent this issue:


  • 设置复制本地=真正的虚拟主机提供商

  • 新增的WebAPI 2.2从的NuGet

  • 的System.Web.Http.WebHost存在我的bin文件夹

  • 我的web.config具有以下dependentAssembly:

code:

  <dependentAssembly>
    <assemblyIdentity name="System.Web.Http.WebHost" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
  </dependentAssembly>

我仍然得到错误,有什么我做错了?

I still get the error, what am i doing wrong?

推荐答案

您可能需要检查网络配置在意见的文件夹,如果你有一个,以确保它具有适当的绑定重定向像你在你的主Web配置。

You may need to check the web config in your "views" folder if you have one to make sure it has the proper binding redirect like you have in your main web config.

这篇关于无法加载文件或程序集“System.Web.Http.WebHost”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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