[英]How do you solve the following error “could not load file or assembly 'microsoft aspnetcore razor runtime 3.1 1”
Am building an API with .net core 3.0, when I run a build my code compiles with no errors or warnings but when I run the app in my add-controllers service I get an error that says "could not load file or assembly 'microsoft aspnetcore razor runtime 3.1 1".正在使用 .net 核心 3.0 构建 API,当我运行构建时,我的代码编译时没有错误或警告,但是当我在我的添加控制器服务中运行应用程序时,我收到一条错误消息,提示“无法加载文件或程序集”microsoft aspnetcore razor 运行时 3.1 1"。
APIs don't have (and don't need) the razor engine loaded. API 没有(也不需要)加载 razor 引擎。 Check if you have Razor from NuGet or install it.
检查您是否有来自 NuGet 的 Razor 或安装它。
You must also understand what you need from razor.您还必须了解您对 razor 的需求。 It is used for rendering views and APIs don't have views.
它用于渲染视图,API 没有视图。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.