I'm running into this issue after upgrading to VS2022 from VS2019.
I have a Project A which has these top level nuget packages (using nuget PackageReference)
- NewtonSoft.Json
- MailKit
- HtmlAgilityPack
- INIFileParserDotNetCore.Signed
As part of these packages nuget all identified a whole bunch of Transitive packages including BouncyCastle.Cryptography, MimeKit, System.Buffers and a bunch of System.xxx packages including on package called System.Runtime.CompilerServices.Unsafe
.
Then I have Project B which has a dependency on Project A (above) (there are no other direct dependencies or nuget packages in Project B)
My understanding is that I don't need to install transitive packages and that the system takes care of it automatically while building.
When I build Project A, all the transitive dependencies show in the bin folder.
However when I build Project B, all the transitive dependencies except for System.Runtime.CompilerServices.Unsafe
are showing in the bin folder. That's causing a lot of grief because when Project B calls a method in Project A, it requires System.Runtime.CompilerServices.Unsafe
to operate and instead now throws an exception that it can't load the System.Runtime.CompilerServices.Unsafe
dll.
Why is that just that one System.Runtime.CompilerServices.Unsafe
transitive dependency is not working it way into Project B? It was working perfectly in VS2019 but after upgrading to VS2022 it's stopped working. Do I need to manually install transitive dependencies or is something about VS2022 different from VS2019. What's the correct way to fix it?
PS - I've tried to remove ALL nuget packages and then reinstall them, that didn't work (actually at first something was wrong with Nuget, it never created references to installed packages, but after a clean reinstall it then finally created the references to the installed packages, but that one transitive packages still don't show in Project B after building it or in the dependencies)