Asp.net 在此上下文中不可访问,因为它是朋友
我从另一个C#项目中提取了一些代码并将其转换为vb,但现在我得到了错误:Asp.net 在此上下文中不可访问,因为它是朋友,asp.net,vb.net,webforms,cryptography,saml,Asp.net,Vb.net,Webforms,Cryptography,Saml,我从另一个C#项目中提取了一些代码并将其转换为vb,但现在我得到了错误: 在此上下文中不可访问,因为它是friend Imports System.Security.Cryptography Public Shared Sub Sign() CryptoConfig.AddAlgorithm(GetType(RSAPKCS1SHA256SignatureDescription), "http://www.w3.org/2000/09/xmldsig-more#rsa-sha256")
在此上下文中不可访问,因为它是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
所需的是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
注意错误消息是如何引用
系统.安全.加密.RSAPKCS1SHA256SignatureDescription
?这就是您的代码所引用的类,并且该类被声明为Friend
,因此您不能使用它。如果需要System.Deployment.Internal.CodeSigning.RSAPKCS1SHA256SignatureDescription
类,则需要导入该命名空间
System.Deployment
命名空间首先需要添加到项目中,以便引用内部.CodeSigning
库