Home > Software design >  System.Security.Cryptography.Algorithms dll in .net 4.8
System.Security.Cryptography.Algorithms dll in .net 4.8

Time:01-06

I have a console application in visual studio 2015.(.Net FrameWork 4.8)
I've added 3 dlls to this app by NuGet installation like below :

System.Security.Cryptography.Algorithms System.Security.Cryptography.Encoding System.Security.Cryptography.Primitives

But i have error in this line of c# :

using System.Security.Cryptography.Algorithms;

The type or namespace name 'Algorithms' does not exist in the namespace 'System.Security.Cryptography' (are you missing an assembly reference?)

What is the problem and how can i fix it?

CodePudding user response:

Two things to note here:

  • The AesGcm implementation you're looking for is not available for .NET Framework 4.8, hence the failure to resolve the desired type name. For a cross-platform implementation it looks like you'll need to upgrade to .NET 5.0
  • System.Security.Cryptography.Algorithms is not a namespace - it's just the name of the assembly (the DLL file on disk) that contains a number of cryptographic algorithm implementations. All public types contained in the corresponding DLL are namespaced to System.Security.Cryptography, so the qualified type name for AesGcm would have been:
    • System.Security.Cryptography.AesGcm
  •  Tags:  
  • Related