dotnet / NuGet.BuildTasks

The build tasks used to pick up package content from project.lock.json.
MIT License
45 stars 61 forks source link

Method 'get_BuildEngine' in type 'NuGet.Build.Tasks.RestoreTask' from assembly 'NuGet.Build.Tasks' #94

Closed drano closed 3 years ago

drano commented 3 years ago

Context

I have some errors when need to execute unit tests (mstest) that rebuild projects. When this failed project is directly built, the build is ok.

Error message:

MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1662,5): error MSB4062: The "NuGet.Build.Tasks.GetReferenceNearestTargetFrameworkTask" task could not be loaded from the assembly d:\Tools\VS2019Community\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.Build.Tasks.dll. Method 'get_BuildEngine' in type 'NuGet.Build.Tasks.RestoreTask' from assembly 'NuGet.Build.Tasks, Version=5.8.0.6930, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation. 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

drano commented 3 years ago

This problem is solved with Visual Studio: Version 16.9.0 Preview 2.0