ASP.NET Core 2.1 CI/CD 使用 VSTS 构建错误

ASP.NET Core 2.1 CI/CD build error using VSTS

我在 VS2017 中创建了一个全新的 ASP.NET Core 2.1 项目,然后我在 VSTS 中使用 'ASP.NET Core' 创建了一个 VSTS 管道。当构建运行时,我总是收到此错误:

The "WebCompiler.CompilerBuildTask" task could not be loaded from the assembly C:\Users\VssAdministrator.nuget\packages\buildwebcompiler.11.326\build..\tools\WebCompiler.exe. Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [D:\a\s\SukiCore\SukiCore.csproj]

那么我应该怎么做才能解决这个问题?

好的,出于某种原因我在 .csproj 文件中有这个,所以当我注释掉它时它开始工作:

<!--<PackageReference Include="BuildWebCompiler" Version="1.11.326" />-->

我认为它是在我使用解决方案资源管理器中的 'Add View' 菜单添加新视图时出现的。