System.Security.Cryptography not found
You need to add a reference to the System.Security.Cryptography.X509Certificates NuGet project to your ASP.NET project.
.NET Core (which is what the new ASP.NET uses) is a component based architecture, you need to import the packages of the features you want. When you searched in Visual Studio you likely did not have the "Include Prerelease" option checked so the libraries for .NET Core where filtered out.
KateMak
Updated on June 15, 2022Comments
-
KateMak almost 2 years
I am trying to add a reference to System.Security.Cryptography.X509Certificates but I get: "The type or namespace 'Cryptography' does not exist in the namespace 'System.Security'.
I have tried adding System.Security to references, I have tried adding System.Security.dll, I have tried adding mscorlib.dll, I have tried to find how to add Windows.Security.Cryptography.
No luck, therefore I cannot use the X509Certificate2 class, which I need.
Has anyone run into this impossibly frustrating situation?
UPDATE:
Looking at this question, RandomNumberGenerator in ASP.NET5 I cannot find what I am looking for in Nuget. In nuget, I only see System.Security.Cryptography.Hashing.Algorithms.Analyzers. I need System.Security.Cryptography.X509Certificates
-
KateMak almost 8 yearsWhen I search System.Security.Cryptography in Nuget, I can only find System.Security.Cryptography.Hashing.Algorithms.Analyzers
-
Scott Chamberlain almost 8 years
-
KateMak almost 8 yearsApparently I did not have the right release version which is why it was not working. Thank you for your input!!
-
Ermir Beqiraj over 4 yearsBesides what the solution suggests, I had to remove the binding redirects from .netframework project