2017-02-23 122 views
0

我的代碼開頭:錯誤類型 'XmlDsigC14NTransform' 沒有定義

Imports System.Security.Cryptography 
Imports System.Text 
Imports System.Xml 
Imports System.IO 

但是當我嘗試使用C14N規範化我的XML文檔:

Dim c14n = New XmlDsigC14NTransform 

我得到一個錯誤:

Code BC30002 Type 'XmlDsigC14NTransform' is not defined

我以前使用過相同的代碼,沒有錯誤。我正在使用目標框架.NET Framework 4客戶端配置文件,是否可能我缺少參考?

回答

1

如果您還沒有這樣做,則需要添加對System.Security的引用。然後加入Imports System.Security.Cryptography.Xml到您的進口清單(或完全限定XmlDsigC14NTransform

命名空間和組件在MSDN's article on XmlDsigC14NTransform記錄。

+0

我已經加入到System.Security的引用,但添加缺少進口System.Security。 Cryptography.Xml修復它,謝謝 – DovesandChicks