无法加载文件或程序System.Web.Http,版本= 5.2.2.0 [英] Could not load file or assembly System.Web.Http, Version=5.2.2.0

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

问题描述

我刚刚上传了一个Asp.Net的Web API 2.2项目到生产服务器,并在标题中获得规定的错误。在我的web.config我已经有:

I just uploaded a Asp.Net Web Api 2.2 project to production server and the get the error stated in the title. In my Web.config I already have the:

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

和文件不垃圾箱存在。什么会导致此?我所有的Asp.Net的Web API文件是最新的,并显示为5.2.2版本。它工作正常我的开发机器上。

And the file does exist in the bin. What would cause this? All my Asp.Net Web API files are up to date and show 5.2.2 as the version. And it works fine on my dev machine.

推荐答案

设置复制本地真正在为 System.Web.Http System.Web.Http.WebHost 组件的属性并重新部署软件包。

Set Copy Local to true in the properties for the System.Web.Http and System.Web.Http.WebHost assemblies and redeploy the package.

如果这不能解决您的问题完全请尝试重新安装的NuGet包。希望这将纠正坏了依赖。从包管理控制台,运行此命令:

If this doesn't solve your problem completely try reinstalling the NuGet package. This will hopefully correct broken dependencies. From the package management console, run this command:

Update-Package Microsoft.AspNet.WebApi -reinstall

请务必安装 System.Web.Http.WebHost 以及

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

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