Mik*_*e_G 22 asp.net web-config assemblybinding asp.net-web-api assembly-binding-redirect
我刚刚将Asp.Net Web Api 2.2项目上传到生产服务器,我收到了标题中的错误.
在我的Web.config中我已经有了这个:
 <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>
该文件确实存在于bin中.什么会导致这个?
我的所有Asp.Net Web API文件都是最新的,并显示5.2.2作为版本.它在我的开发机器上工作正常.
Mih*_*scu 36
设置Copy Local于true在对性能System.Web.Http和System.Web.Http.WebHost组件并重新部署软件包.
如果这不能解决您的问题,请尝试重新安装NuGet包.这有望纠正破坏的依赖关系.从包管理控制台,运行以下命令:
Update-Package Microsoft.AspNet.WebApi -reinstall
一定要安装System.Web.Http.WebHost.
对我来说,从"解决方案资源管理器"我检查了项目引用中的"System.Web.Http"的版本,这是5.2.3.0所以,在web.config中,我更改了:
<bindingRedirect oldVersion="0.0.0.0-5.2.2.0" newVersion="5.2.2.0" /> 
至
<bindingRedirect oldVersion="0.0.0.0-5.2.2.0" newVersion="5.2.3.0" />
然后建立.它对我有用!
| 归档时间: | 
 | 
| 查看次数: | 44060 次 | 
| 最近记录: |