我最近安装了Alpha预览版.NET Core,并将MSBuildSdksPath设置为指向它。在那个dotnet发布甚至是dotnet恢复失败之后,所以我删除了环境变量,但是现在它失败了:
error MSB4062: The "CheckForImplicitPackageReferenceOverrides" task could not be loaded from the assembly C:\Program Files\dotnet\sdk\2.2.103\Sdks\Microsoft.NET.Sdk\targets\..\tools\netcoreapp2.0/Microsoft.NET.Build.Tasks.dll. Assembly with same name is already loaded Confirm that the <UsingTask> 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. [c:\Workspace\Telesis\Configuration.Repositories\Configuration.Repositories.csproj]
答案 0 :(得分:0)
在https://github.com/dotnet/cli/issues/9759中,我发现了这一点:
如果遇到错误且未设置MSBuildSdksPath,则可以尝试
dotnet build-server shutdown
我跑了dotnet build-server shutdown
,然后dotnet restore
工作了。