Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to reference Newtonsoft.Json version 9.0.0.0 #88

Open
lokesh-zende opened this issue May 24, 2017 · 4 comments
Open

Unable to reference Newtonsoft.Json version 9.0.0.0 #88

lokesh-zende opened this issue May 24, 2017 · 4 comments

Comments

@lokesh-zende
Copy link

Hi,
In my application, I am trying to read a file from data lake store.
I read a file using

DataLakeStoreFileSystemManagementClient _adlsFileSystemClient;
Stream str = _adlsFileSystemClient.FileSystem.Open("adl1", "//TestETL//TestData.tsv");

I observed that, for DataLakeStoreFileSystemManagementClient to read a file, it requires Newtonsoft.Json version 6.0.0.0.
Where as to login to Azure UserTokenProvider.LoginSilentAsync depends on Newtonsoft.Json version 9.0.0.0 or greater.
In my application, I am using Newtonsoft.Json version 9.0.0.0.

When I create an assembly of my application and try to use it in USQL job, the job fails with error

image

This shows that USQL needs Newtonsoft.Json version 6.0.0.0 to read a file from DLS whereas Microsoft.Rest.Azure.Authentication depends on Newtonsoft.Json version 9.0.0.0 or greater.

If I use Newtonsoft.Json version 6.0.0.0 then my authentication fails.

I am stuck in this.
Any solution / work around appreciated.

Thanks,
Lokesh.

@viblo
Copy link

viblo commented Jun 20, 2017

The same problem happens with the included DataFormats example found here: https://github.com/Azure/usql/tree/master/Examples/DataFormats

The project references Newtonsoft.Json 8.0.0.0, but Microsoft.Hadoop.Avro which is included references Newtonsoft.Json 6.0.0.0 so when I try to run it I get the same error as Lokesh.

This is what AsmSpy shows:

Reference: Newtonsoft.Json
  Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
  Source: NotFound
    6.0.0.0 by Microsoft.Hadoop.Avro, Version=1.5.6.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
  Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
  Source: Local, Location: C:\Users\blomqvist\Downloads\AsmSpy\Newtonsoft.Json.dll
    8.0.0.0 by Microsoft.Analytics.Samples.Formats, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null

@rwforest
Copy link

You need to downgrade to JSON 6.0, if you have nuget, change the version to older one, 2015-ish...

@viblo
Copy link

viblo commented Aug 9, 2017

Yes, I should have mentioned that is exactly the workaround I used.
Now my packages.config in the DataFormats example looks like this:

<packages>
  <package id="Microsoft.Hadoop.Avro" version="1.5.6" targetFramework="net45" />
  <package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
</packages>

@Mikeprod
Copy link

I had to downgrade the Newtonsoft.Json package to 6.0.7, because 6.0.8 was not making the assembly to recognize the 6.0.0.0.0 version 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants