The following build error is pestering me.
The "CompareCommonBuildTaskVersion" task could not be loaded from the assembly C:\Users\Thijs\.nuget\packages\microsoft.vssdk.buildtools\16.6.1026\tools\VSSDK\Microsoft.VisualStudio.Sdk.BuildTasks.dll.
Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
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.
I just checked the directory mentioned, and there is a Newtonsoft.Json.dll there, but it's version 12.0.2.23222 (File Version).
I'm using:
Upon reading the link EricEJ posted I checked my devenv.exe.config which has the following (correct) AssemblyRedirect:
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
<bindingRedirect oldVersion="4.5.0.0-12.0.0.0" newVersion="12.0.0.2"/>
<codeBase version="12.0.0.2" href="PrivateAssemblies\Newtonsoft.Json.12.0.0.2\Newtonsoft.Json.dll"/>
</dependentAssembly>
Problem seems to be with the actual BuildTools package (see answer).
I tried the different BuildTools package versions again, starting from the newest and after installing, restarted VS and then did a rebuild of the solution:
So far it seems the downgrade has resolved my issues.