-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
AssemblyVersion only contains Major version causes DLL conflicts #2887
Comments
…sion to avoid version mismatch with dlls in GAC
We are having similar issue. The azure build pipeline artefact throws EDIT: I downgraded from 13.0.3 to 13.0.1, but this has a bizarre affect. It works in couple of places and fails in another with the same issue. NOTE: Again - it works fine if I publish it locally and apply it. But the behavior observed when using package from Azure pipeline. Is this an issue with Azure vms? |
Several other examples of the issue popping up. https://developercommunity.visualstudio.com/t/cannot-sign-in-to-visual-studio/105291 |
Here's a PR attempting to make the stated adjustment: #2976. It needs a test and the change + fix need to be verified. |
Environment
I am using Nuget package 13.0.3 and my application has target framework net48.
On a customer machine any other tool has registered an older version (probably 13.0.1) of Newtonsoft.Json in GAC (Global Assembly Cache).
Both versions of Newtonsoft have Assembly version 13.0.0.0.
Even though our application does not register Newtonsoft in GAC, we still break because another application, which is out of our control, (not really sure which one it is) and installed on client machine registers in GAC.
So you get the complains by the customer, even though it is not even your fault.
In my opinion the Assembly version should always contain the Major and Release version number. In this way the application is able to determine if there is the same version in GAC or not.
Source code
Expected behavior
The assembly Newtonsoft v 13.0.3.0 out of my binary directory should get loaded.
Actual behavior
The assembly gets loaded from GAC and causes following exception to be thrown, because this constructor has been introduced with version 13.0.2.
System.MissingMethodException: 'Method not found: 'Void Newtonsoft.Json.JsonSerializerSettings..ctor(Newtonsoft.Json.JsonSerializerSettings)'.'
Steps to reproduce
gacutil.exe /i "C:\temp\Json130r1\Bin\net45\Newtonsoft.Json.dll"
For reference to cleanup your local machine again:
To unregister the assembly from GAC run
gacutil.exe /u Newtonsoft.Json
The text was updated successfully, but these errors were encountered: