我的 API 中存在以下问题,当我尝试在本地主机中运行代码时,代码运行正常,但是当我尝试发布它时,出现此错误
帮助!!
Error The command ""dotnet" exec --runtimeconfig "~\xxxx-api\API.xxxx\bin\Release\netcoreapp2.0\API.xxxx.runtimeconfig.json" --depsfile "~\xxxx-api\API.xxxx\bin\Release\netcoreapp2.0\API.xxxx.deps.json" "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc.razor.viewcompilation\2.0.0\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.dll" @"obj\Release\netcoreapp2.0\microsoft.aspnetcore.mvc.razor.viewcompilation.rsp"" exited with code 1. API.xxxx 0
最佳答案
以防万一有人遇到同样的问题:
在 csproj 上添加这行代码:
<ProperyGroup>
...
<MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>
</ProperyGroup>
https://github.com/aspnet/Mvc/issues/6659
https://github.com/aspnet/Mvc/issues/7393
关于json - dotnet 编译错误; aspnetcore.mvc.razor.viewcompliation.rsp 退出,代码为 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47130104/