Error CS0433 The type 'HashAlgorithm' exists in both System.Security.Cryptography.Hashing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System.Security.Cryptography.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
我创建了一个针对 dnx46
和 dnxcore50
的类库。当我引用 HashAlgorithm 类时,Visual Studio 2015 给出了上述错误。处理这种情况的通常方法是什么?使用外部别名?
最佳答案
尝试使用完全限定名称,例如
System.Security.Cryptography.HashAlgorithm hashAlgorithm
或者您可以查看extern alias ,还要检查这些问题:
关于c# - System.Security.Cryptography.HMACSHA1 存在于具有相同命名空间的两个程序集中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32086297/