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

Assembly Newtonsoft.Json Issue. #83

Open
MAKARANDKURKUTE opened this issue Mar 4, 2021 · 1 comment
Open

Assembly Newtonsoft.Json Issue. #83

MAKARANDKURKUTE opened this issue Mar 4, 2021 · 1 comment

Comments

@MAKARANDKURKUTE
Copy link

I recently updated Newtonsoft.Json assembly with 12.0.0.0 with TweetSharp 6.0.2.0. I have other projects which are dependent on latest Newtonsoft.Json12.0.0.0 version.

I am getting following error with Tweeter API.

Could not load file or assembly 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.

Tried by changing app.config by adding bindingRedirect oldVersion="0.0.0.0-11.0.0.0" to Newtonsoft.Json but not working.

also tried by creating TweetSharp.dll.config with oldVersion setting but not working.

Any suggestion, How can I fix this issue?

Thanks in advance,
-Mak

@Liebeck
Copy link

Liebeck commented Jan 30, 2022

@MAKARANDKURKUTE I had the same issue. From reading https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#controlling-dependency-assets , I learned that you can control which dependency should flow to the parent project.

In this case, we don't want Newtonsoft.Json 11.0.0.0 to flow to our project.

This line works for me
<PackageReference Include="TweetMoaSharp" Version="6.0.2" PrivateAssets="Newtonsoft.Json" />

If anyone finds a better solution, please let me know 😉

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

2 participants