c# - 全新 ASP.NET Core 2.1 项目的构建时间缓慢

标签 c# visual-studio asp.net-core build asp.net-core-2.1

我在 visual studio 15.7.3 中创建了一个全新的 ASP.NET Core 2.1 应用程序。

新创建的应用程序的构建时间非常慢,大约 20 秒。

尽我所能跟踪构建,它似乎停滞在这里:

1>    C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc.razor.extensions\2.1.0\lib\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.Extensions.dll
1>    '
1>    Server execution failed with response Rejected. For more info, check 
the server log file in the location specified by the RAZORBUILDSERVER_LOG 
environment variable.
1>    Fallback to in-process execution.

这肯定不正常,有人知道我该如何解决这个问题吗?

最佳答案

如果您的用户名中有空格,则会出现错误 - 请参阅 https://github.com/aspnet/Razor/issues/2406

对我有用的解决方案是将以下内容放入我的 csproj 文件

<PropertyGroup>
  <!-- see https://github.com/aspnet/Razor/issues/2406 -->
  <_RazorBuildServerPipeName>razor-issues-2406</_RazorBuildServerPipeName>
</PropertyGroup>

关于c# - 全新 ASP.NET Core 2.1 项目的构建时间缓慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50654690/

相关文章:

c# - 如何返回 IQueryable<T> 以供进一步查询

c# - URL 重写中间件 ASP.Net Core 2.0

c# - EntityFramework 核心 2 - ValueGeneratedOnAddOrUpdate

iis - IIS 上的 ASP.NET Core 2.0 错误 502.5

c# - 如何确定 C# 泛型类型的无参数类型以进行检查?

c# - C++ 后端与 C# 前端?

c# - 高频堆

c# - 为什么在传递 "null"常量时会出现异常,而在传递 "null"字符串引用时却不会?

c# - Nuget SQL Compact,可部署程序集

visual-studio - 无效的MEX(找不到指定的过程): Building a CUDA MEX function in visual studio and calling it in MATLAB