Search code examples
c#asp.net-core-mvc.net-framework-version

System.Security.Cryptography namespace not available in .NET framework 5.4


Please help guys.

I created a new project Class Library (Package) in Visual Studio 2015. I want to use this project in MVC 6 project. Now it complains that Cryptography does not exist in System.Security even after I have added reference to System.Security.

Even if I have the code directly to the MVC 6 project it's still complaining.

enter image description here

I am not sure whether it has to do with the .NET Framework version because it also shows that this namespace is not available in framework 5.4

enter image description here

Thank you guys for your help.


Solution

  • Thank you so much guys for your help. I managed to get it working by removing the dotnet5.4 framework from the project.json file. See screenshot below

    enter image description here

    This framework get added automatically when you create a new project, even if you select framework 4.5.1.

    Thank you again.