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

Rea*_*idy 3 c# build visual-studio asp.net-core 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.
Run Code Online (Sandbox Code Playgroud)

当然这不正常,任何人都知道如何解决这个问题?

Dav*_*emp 6

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

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

<PropertyGroup>
  <!-- see https://github.com/aspnet/Razor/issues/2406 -->
  <_RazorBuildServerPipeName>razor-issues-2406</_RazorBuildServerPipeName>
</PropertyGroup>
Run Code Online (Sandbox Code Playgroud)

  • TL; DR:只有当您的用户名中有空格时,此修复程序才会对您有所帮助.我没有,也没有. (2认同)