我从另一个C#项目中提取了一些代码,并将其转换为vb,但现在出现错误:
Is not accessible in this context because it is friend
Imports System.Security.Cryptography
Public Shared Sub Sign()
CryptoConfig.AddAlgorithm(GetType(RSAPKCS1SHA256SignatureDescription), "http://www.w3.org/2000/09/xmldsig-more#rsa-sha256")
End Sub
所需的namespace是System.Deployment.Internal.CodeSigning
,但此命名空间似乎没有RSAPKCS1SHA256SignatureDescription
。
正在导入的名称空间是System.Security.Cryptography
,但我开始认为这是从错误的库派生的。
Imports System.Security.Cryptography
Namespace System.Security.Cryptography
Friend Class RSAPKCS1SHA256SignatureDescription
Inherits RSAPKCS1SignatureDescription
Public Sub New()
End Class
End Namespace
任何人都可以深入了解此错误消息吗?
此错误似乎并不代表微软所说的是:
错误ID:BC30389
https://docs.microsoft.com/en-us/dotnet/visual-basic/misc/bc30389