tfs - 从 TFS2017 到 Azure VM 的 Azure 复制错误:无法加载文件或程序集 'Newtonsoft.Json,版本 = 9.0.0.0
问题描述
我是一个玩 TFS 的新手,所以你可能需要解释一下这是怎么回事。
我被要求使用我们的现场 TFS 构建管道将 Blob 文件上传到 Azure VM。
我们在 TFS 中使用 TFS 2017 和 Azure 文件复制任务(版本 1.0)。
我收到以下错误:
> 2020-07-31T09:07:45.4248226Z ##[command]Import-Module -Name C:\Program Files\WindowsPowerShell\Modules\AzureRM\5.7.0\AzureRM.psd1 -Global
> 2020-07-31T09:07:45.8779680Z ##[error]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.
> 2020-07-31T09:07:45.9092180Z ##[section]Finishing: Azure Blob File Copy
我在位于 Microsoft.Net\Framework64\v4.0.30319 的 machine.config 文件中有以下内容
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
解决方案
这可能是由本地代理计算机上旧版本的 azure powershell 引起的。据说最新版本的 azure powershell 修复了错误Could not load file or assembly 'Newtonsoft.Json...'
Checkout a similar issue here以获取更多信息。
您可以尝试将本地代理计算机上的 azure powershell 升级到最新版本。
点击这里下载最新的 6.2.1 版本。(azure powershell 是Azure 文件复制 任务的先决条件 )。
推荐阅读
- java - 使用 HashSet 从排序数组中删除重复项
- dart - Flutter - 更改 OutlineInputBorder 的边框颜色
- powershell - 将复制项运行到 PSSession 时出现烦人的消息
- javascript - 根据数组Angular中的位置删除和添加类
- c++ - C++ 通过 copy() 输出
- c# - Azure 日志分析 .NET SDK 中的跨工作区查询
- scheme - 如何从 MIT Scheme 访问环境变量?
- python - 使用 pd.DataFrame.loc 分配
- c++ - c++中基类如何调用派生类传递的闭包?
- php - 抽象类说找不到