Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Visual Studio 2022 not adding transitive dependency for System.Runtime.CompilerServices.Unsafe.dll

$
0
0

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)

  1. NewtonSoft.Json
  2. MailKit
  3. HtmlAgilityPack
  4. 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)


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>