question

SamudraBanerjee-5885 avatar image
1 Vote"
SamudraBanerjee-5885 asked SamudraBanerjee-5885 answered

Version Conflict despite AutoUnify being set to true

Hi all,

We have a project with a dependency on NewtonSoft.json version 12.0.3, to which we are adding as dependency, another project which depends on 13.0.1. With autounify being set to true, we expect this conflict to be resolved to the latest version of the library. However, we get the below warning in the build logs.

235859-image.png

Looks like the only reference which depends on version 12 is the Newtonsoft.json library itself, which is weird. Does anyone have any idea why we are seeing this behavior?

Here is the binlog file for reference - https://microsoft-my.sharepoint.com/:u:/p/sabaner/EZitcfiQmKZHq6ZxWYj9XSkBlmwuo49Z_BwM-bNtPkbdTA?e=cbTs54 (Search "References which depend on Newtonsoft.Json")


dotnet-csharpvs-msbuild
image.png (104.1 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AnnaXiu-MSFT avatar image
0 Votes"
AnnaXiu-MSFT answered SamudraBanerjee-5885 edited

Hi @SamudraBanerjee-5885 ,

Welcome to Microsoft Q&A!

Which version of Visual Studio are you using? Please clean and rebuild your project to try again.

Besides, can you open the App.config file? Please find the bindingRedirect entry for Newtonsoft.Json assembly and check if the old and new versions are specified.

Sincerely,
Anna


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @AnnaXiu-MSFT,

Thanks for the quick response!

We are facing this issue with command-line MSBuild (version 17.2.1 for .NET Framework - see attached binlog), not Visual Studio. Have also tried a clean and rebuild.

Also, this is compilation for a DLL, hence there is no App.config (as far as we can tell). AutoUnify should auto generate the binding redirect.

0 Votes 0 ·
SamudraBanerjee-5885 avatar image
0 Votes"
SamudraBanerjee-5885 answered

We checked with a Visual Studio dev, and he mentioned that this is expected in msbuild since our primary reference is version 12. There may be a hack around it, but the recommendation was to upgrade to version 13.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.