请大家帮忙
我在 Visual Studio 2015 中创建了一个新项目 Class Library (Package)
。
我想在 MVC 6 项目中使用这个项目。
现在它提示说密码术在 System.Security 中不存在,即使在我添加了对 System.Security 的引用之后也是如此。
即使我有直接指向 MVC 6 项目的代码,它仍然在提示。
我不确定它是否与.NET Framework 版本有关,因为它还表明该命名空间在Framework 5.4 中不可用
谢谢大家的帮助。
最佳答案
如果这是 RC2,则引入 netstandard1.5
var aes = System.Security.Cryptography.Aes.Create();
IIRC net5.4 不再正确,而且看起来你是多目标的,所以可能是这样的:
#if NETSTANDARD1_5
var aes = System.Security.Cryptography.Aes.Create();
#else
var aes = Rijndael.Create();
#endif
关于c# - System.Security.Cryptography 命名空间在 .NET Framework 5.4 中不可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37712984/