【问题标题】:Microsoft.AspNetCore.Mvc.ViewEngines.ViewEngineResult.EnsureSuccessful(IEnumerable<string> originalLocations)Microsoft.AspNetCore.Mvc.ViewEngines.ViewEngineResult.EnsureSuccessful(IEnumerable<string> originalLocations)
【发布时间】:2022-01-17 12:37:26
【问题描述】:

This is the picture of the project error 处理请求时发生未处理的异常。

【问题讨论】:

  • 欢迎来到 StackOverflow!您的问题需要一些工作,以便社区可以更好地帮助您。看看how to ask a good question,再试一次。

标签: asp.net-core-5.0


【解决方案1】:

为现有项目中的所有环境启用运行时编译:

  1. 安装 Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation NuGet 包。
  2. 更新项目的 Startup.ConfigureServices 方法以包含对 AddRazorRuntimeCompilation 的调用。

例如:

public void ConfigureServices(IServiceCollection services) {
services.AddRazorPages().AddRazorRuntimeCompilation();   
// code omitted for brevity    }

Microsoft official program

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-08-01
    • 2011-06-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-23
    相关资源
    最近更新 更多