【问题标题】:Azure App Service throwing Runtime Error: Assembly not FoundAzure App Service 引发运行时错误:未找到程序集
【发布时间】:2020-06-15 22:42:56
【问题描述】:

我正在尝试将 ASP.NET Core Web 应用程序部署到 Azure 应用服务。

我构建了应用服务以使用 .NET Core 3.0 运行时,它在本地框架的该版本上运行良好。但是,当我尝试在 App Service 中运行应用程序时,会遇到以下错误:

Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.Razor.Runtime, Version=3.0.3.0, Culture=neutral, PublicKeyToken=[]'. The system cannot find the file specified.

我没有直接调用 Razor 运行时,所以基本上,我需要弄清楚哪个其他库实际上在请求该程序集,或者,为什么应用程序会在我的本地计算机上运行,​​而不是在应用服务上运行。据说这两个环境都安装了 .NET Core 3.0。

对我来说最大的困惑是 NuGet 没有显示该库超过 2.2 的任何版本。否则我会明确地包含来自 NuGet 的那个包。

如何确定哪个其他程序集正在请求 Razor 运行时,或者至少将该请求解析为有效程序集?

【问题讨论】:

  • 似乎是一些绑定重定向问题。这是一个很好的资源:@​​987654321@
  • @Thiago 感谢资源,现在正在查看。

标签: c# azure asp.net-core asp.net-core-3.0 azure-app-service-envrmnt


【解决方案1】:

Microsoft.VisualStudio.Web.CodeGeneration.Design 是此问题的根源。它正在调用Microsoft.AspNetCore.Razor.Runtime,但据我所知,它并没有直接请求 3.0.3.0。

【讨论】:

    猜你喜欢
    • 2017-08-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-06
    • 2018-10-26
    • 2013-10-22
    • 1970-01-01
    相关资源
    最近更新 更多