从Visual Studio 2017访问Azure数据工厂:Connection正在尝试使用旧版本的Newtonsoft.Json [英] Accessing Azure Data Factory from Visual Studio 2017: Connection is trying to use an old version of Newtonsoft.Json
问题描述
无法加载文件或程序集'Newtonsoft.Json,Version = 6.0.0.0
这是asp.net C#代码:
var context = new AuthenticationContext(" https://login.windows.net/" + tenantID);
ClientCredential cc = new ClientCredential(applicationId,authenticationKey);
      AuthenticationResult result = context.AcquireTokenAsync(" https://management.azure.com/",cc).Result;
      ServiceClientCredentials cred = new TokenCredentials(result.AccessToken);
      var client = new DataFactoryManagementClient(cred){SubscriptionId = subscriptionId};
      string parameters ="" ;;
      client.Pipelines.CreateRunWithHttpMessagesAsync(resourceGroup,dataFactoryName,pipelineName,parameters);
以下是完整的错误消息:
程序集加载跟踪: 以下信息可以有助于确定为什么装配'Newtonsoft.Json,Version = 6.0.0.0,Culture = neutral,
PublicKeyToken = 30ad4fe6b2a6aeed'无法加载。
|
以下是来自web.config的行:
&NBSP; &NBSP; < dependentAssembly>
&NBSP; &NBSP; &NBSP; < assemblyIdentity name =" Newtonsoft.Json"公钥=" 30ad4fe6b2a6aeed"培养= QUOT;中性" />
&NBSP; &NBSP; &NBSP; < bindingRedirect oldVersion =" 0.0.0.0-12.0.0.0" NEWVERSION = QUOT; 12.0.0.0" />
&NBSP; &NBSP; < / dependentAssembly>
bin文件夹中的DLL是12.01,我找不到调用旧版6.0的Newtonsoft.Json 。
嗨Walter,
这个主题的最佳答案可能就是这个诀窍:
版本不同,但同样的推理可能适用于您的场景。
Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0
Here is the asp.net C# code:
var context = new AuthenticationContext("https://login.windows.net/" + tenantID);
ClientCredential cc = new ClientCredential(applicationId, authenticationKey);
AuthenticationResult result = context.AcquireTokenAsync("https://management.azure.com/", cc).Result;
ServiceClientCredentials cred = new TokenCredentials(result.AccessToken);
var client = new DataFactoryManagementClient(cred) { SubscriptionId = subscriptionId };
string parameters = "";
client.Pipelines.CreateRunWithHttpMessagesAsync(resourceGroup, dataFactoryName, pipelineName, parameters);
Here is the full error message:
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' could not be loaded.
|
Here is the line from web.config:
<dependentAssembly><assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
The DLL in the bin folder is 12.01 and I cannot find what is calling the old 6.0 version of Newtonsoft.Json.
Hi Walter,
The top answer in this thread might do the trick:
The version is different but the same reasoning might apply to your scenario.
这篇关于从Visual Studio 2017访问Azure数据工厂:Connection正在尝试使用旧版本的Newtonsoft.Json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!