Detected package downgrade: Microsoft.Win32.Primitives from 4.3.0 to 4.0.1
With version 5.6.0 there is a package resolve issue when building for .net 9 and a runtime identifier win-x64. This is due to a bug in NETStandard.Library 1.6.0.
dotnet build MyProject.csproj -r win-x64
Warning As Error: Detected package downgrade: Microsoft.Win32.Primitives from 4.3.0 to 4.0.1. Reference the package directly from the project to select a different version.
MyProject -> NHibernate 5.6.0 -> Antlr3.Runtime 3.5.1 -> NETStandard.Library 1.6.0 -> System.Net.Primitives 4.0.11 -> runtime.win.System.Net.Primitives 4.3.0 -> Microsoft.Win32.Primitives (>= 4.3.0)
MyProject -> NHibernate 5.6.0 -> Antlr3.Runtime 3.5.1 -> NETStandard.Library 1.6.0 -> Microsoft.Win32.Primitives (>= 4.0.1)
When using NHibernate 5.5.3 this issue does not appear since instead of NETStandard.Library 1.6.0 it resolves to NETStandard.Library 1.6.1 which doesn't have this bug.
And the reason why NETStandard.Library is downgraded from 1.6.1 to 1.6.0 when updating NHibernate from 5.5.3 to 5.6.0 is the updated Iesi.Collections.
5.5.3 was using Iesi.Collections 4.0.4 where the used dependency was .NETStandard 1.3 and therefore NETStandard.Library 1.6.0.
5.6.0 is now using Iesi.Collections 4.1.1 where the used dependency is .net8.0 which has no dependency to NETStandard.Library which results in the use of NETStandard.Library 1.6.0 referenced by Antlr3.Runtime 3.5.1
The workaround for now is to include NETStandard.Library 1.6.1 in my project, but I believe this should be fixed within NHibernate.
@MuhKuh7 with only NHibernate 5.6.0 referenced I do not see that runtime.win.System.Net.Primitives 4.3.0 get's referenced at all. In other words I cannot reproduce the issue. What other dependencies do you have?
@MuhKuh7 with only NHibernate 5.6.0 referenced I do not see that
runtime.win.System.Net.Primitives4.3.0 get's referenced at all. In other words I cannot reproduce the issue. What other dependencies do you have?
No other dependencies in the test project I created. Did you build with runtime identifier win-x64? Otherwise it won't get referenced.
Yes, i did. But I don’t have windows machine, so I built on Mac.
I don't have access to my PC at the moment, but I can try it on a Mac next week and maybe upload the test project somewhere. Of course it could also be that something changed in the last 2 weeks.