gpt4 book ai didi

c# - 无法加载文件或程序集 'System.Web.Http.WebHost'

转载 作者:行者123 更新时间:2023-11-30 18:27:11 24 4
gpt4 key购买 nike

将 MVC 网页部署到我的 IIS 后,出现以下错误:

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. 

我已进行以下更改以防止出现此问题:

  • 为虚拟主机设置 Copy Local = True
  • 从 nuget 添加了 WebApi 2.2
  • System.Web.Http.WebHost 存在于 bin 文件夹中
  • 我的 web.config 具有以下依赖程序集:

代码:

  <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>

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

最佳答案

您可能需要检查“views”文件夹中的网络配置,如果您有一个以确保它具有正确的绑定(bind)重定向,就像您在主网络配置中一样。

关于c# - 无法加载文件或程序集 'System.Web.Http.WebHost',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27167130/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com