简体   繁体   中英

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".

APIs don't have (and don't need) the razor engine loaded. Check if you have Razor from NuGet or install it.

You must also understand what you need from razor. It is used for rendering views and APIs don't have views.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM