网站发布到虚拟空间后,提示以下错误:在上下文中找不到 owin.Environment 项”,百度了好长时间都没有解决。最后在web.config中添加以下配置。

<system.webServer>
    <handlers>
      <add name="OWIN" path="*" verb="*" type="Microsoft.Owin.Host.SystemWeb.OwinHttpHandler" />
    </handlers>
</system.webServer>

问题貌似解决了。但新的问题来了。所有的静态内容加载异常。最后的修改方法是,去掉以上代码,给

modules节点添加runAllManagedModulesForAllRequests="true",代码如下:

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="FormsAuthentication" />
      以下内容省略
    </modules>
  </system.webServer>
虽然问题解决了,但是还是不知道问题所在,还望大神不吝赐教。

相关文章:

  • 2021-09-03
  • 2021-12-10
  • 2021-10-19
  • 2022-12-23
  • 2021-11-14
  • 2021-10-31
  • 2021-03-31
猜你喜欢
  • 2021-12-18
  • 2022-12-23
  • 2021-08-25
  • 2021-11-20
  • 2021-12-28
  • 2021-09-18
相关资源
相似解决方案