.net core dotnet还原失败,错误为MSB4062:;检查隐式PackageReferenceOverrides“;无法加载任务

.net core dotnet还原失败,错误为MSB4062:;检查隐式PackageReferenceOverrides“;无法加载任务,.net-core,.net Core,我最近安装了alpha预览.NET核心版本,并将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.

我最近安装了alpha预览.NET核心版本,并将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]
错误MSB4062:无法从程序集C:\Program Files\dotnet\sdk\2.2.103\Sdks\Microsoft.NET.sdk\targets\..\tools\netcoreapp2.0/Microsoft.NET.Build.Tasks.dll加载“CheckForImplicitPackageReferenceOverrides”任务。已加载同名的程序集。请确认声明正确,程序集及其所有依赖项可用,并且任务包含实现Microsoft.Build.Framework.ITask的公共类。[c:\Workspace\Telesis\Configuration.Repositories\Configuration.Repositories.csproj]
从我发现的:

如果遇到错误并且尚未设置MSBuildSdksPath,则可以尝试关闭
dotnet生成服务器


我运行了
dotnet build server shutdown
,之后
dotnet restore
工作了。

由于您的问题已经三个月了,我想知道您现在是否找到了答案?在Cake脚本中执行“DotNetCorePack”命令时,我遇到相同的错误消息,无法解决它。是的,请参见下面的答案。