sashoalm
sashoalm

Reputation: 79467

dotnet restore fails with error MSB4062: The "CheckForImplicitPackageReferenceOverrides" task could not be loaded

I recently installed the alpha preview .NET Core version and set MSBuildSdksPath to point to it. After that dotnet publish and even dotnet restore failed so I removed the environment variable, but now it fails with this:

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]

Upvotes: 0

Views: 1837

Answers (1)

sashoalm
sashoalm

Reputation: 79467

From https://github.com/dotnet/cli/issues/9759 I found this:

If you encounter the error and haven't set MSBuildSdksPath, then you can try dotnet build-server shutdown

I ran dotnet build-server shutdown and after that dotnet restore worked.

Upvotes: 0

Related Questions