无法构建干净的VSIX项目:试图加载不存在的Newtonsoft.Json吗?

问题描述 投票:0回答:1

以下构建错误困扰着我。

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.   

我刚刚检查了提到的目录,并且在其中有一个Newtonsoft.Json.dll,但是它的版本为12.0.2.23222(文件版本)。

我正在使用:

  • Visual Studio Enterprise 2019预览版
    • 版本16.6.0预览版1.0
  • Visual Studio Enterprise 2019
    • 版本16.5.0

阅读了EricEJ发布的链接后,我检查了具有以下(正确)AssemblyRedirect的devenv.exe.config:

    <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>

问题似乎与实际的BuildTools软件包有关(请参阅答案)。

c# visual-studio-2019 visual-studio-extensions vsix
1个回答
0
投票
版本16.6.1026-> 3月->不起作用
© www.soinside.com 2019 - 2024. All rights reserved.