简体   繁体   中英

Azure Copy from TFS2017 to Azure VM Error: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0

I am a newbie playing with TFS so you may need to ExplainLikeIamFive what is going on with this.

I have been asked to upload a Blob file to Azure VM from using our onsite TFS build pipelines.

We are using TFS 2017 and the Azure File Copy task (version 1.0) in TFS.

I am getting the following error:

> 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

I have the following in my machine.config file located in Microsoft.Net\Framework64\v4.0.30319

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

It might be caused by the older version of azure powershell on your local agent machine. It is said the latest version of azure powershell fixed the error Could not load file or assembly 'Newtonsoft.Json...' Checkout a similar issue here for more information.

You can have a try upgrading the azure powershell on your local agent machine to the latest version.

Click here download the latest 6.2.1 version. (azure powershell is a prerequisite for Azure File Copy task).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM