ASP.NET Core:在生产中找不到依赖包

时间:2018-01-13 11:29:05

标签: c# asp.net iis asp.net-core .net-core

我有一个针对.NET Core 2.0的ASP.NET Core项目。问题是,当我将项目发布到IIS(通过Visual Studio发布向导)服务器和浏览器时,我面对的网站位于错误页面下方。

IIS Site 502 error

我启用了错误日志,并在日志中找到以下错误:

Error:
  An assembly specified in the application dependencies manifest (RubyVAS.deps.json) was not found:
    package: 'Microsoft.AspNetCore.Antiforgery', version: '2.0.1'
    path: 'lib/netstandard2.0/Microsoft.AspNetCore.Antiforgery.dll'

  This assembly was expected to be in the local runtime store as the application was published using the following target manifest files:
    aspnetcore-store-2.0.3.xml

这也和我一样,但没有一个解决方案有效。

https://github.com/dotnet/coreclr/issues/13542

但是当我用dotnet publish发布它时,错误消失了,但又发生了一件奇怪的事情。这就是[Authorize]过滤器在这种情况下停止工作。这意味着我可以匿名浏览所有控制器操作而无需登录,同时它应该将我重定向到登录页面。但是,当我从Visual Studio中运行项目时,这没有任何问题。我已经搜索了很多这个问题,这不是我startup.cs中的错误配置。

我希望有人知道这里发生了什么?

0 个答案:

没有答案