json - dotnet 编译错误; aspnetcore.mvc.razor.viewcompliation.rsp 退出,代码为 1

标签 json asp.net-mvc razor

我的 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/

    相关文章:

    asp.net - ASP.NET MVC 部分 View 中的 AngularJS

    json - Azure 将 XML 转换为 JSON

    json - 2 oneOf 在 json 模式 : 1 required 1 optional

    asp.net-mvc - 自定义错误重定向在 ASP.NET MVC Web.Config 中不起作用

    c# - Razor 菜单代码插入空白列表项,有人能找出原因吗?

    razor - 具有自动完成功能的轻量级 Razor 编辑器?

    ruby-on-rails - 在 Rails 中使用 JSON

    php - 如何在不使用任何库的情况下在 php 中创建 JSON Rest Web 服务?

    c# - 将数据发布到 HTTPS URL 时,GetRequestStream() 抛出超时异常

    .net - 在单元测试中伪造我的数据库层的方法是什么?