0

I've created a new Blazor WASM project and added to it a NuGet package from my private internal feed (let's call it Package1). Package1 in turn depends on the Portable.BouncyCastle package.

In my Blazor project, when I call methods from the Package1 assembly, I'm getting an exception:

Could not load file or assembly 'BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942'. The system cannot find the file specified.

Why aren't Package1's dependencies being copied locally when I build the project? As far as I can recall, this was never an issue in the old .NET Framework. Add a package to a dependent project, the package's dependencies come along with it.

I see there's a somewhat similar problem going on here, but unfortunately there's been no answer posted so far. There's also this, but it's nine years old and is most certainly irrelevant by now.

My setup:

  • Blazor1: .NET6 Blazor WASM
  • Package1: .NET Standard 2.0

There's nothing in Visual Studio's NuGet Package Manager options that would address this, nor is there a modern equivalent to the old CopyLocal setting in the reference's properties sheet.

How can I get Package1's dependencies copied locally without adding Portable.BouncyCastle to Blazor1?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.