[英]The type or namespace name 'Ports' does not exist in the namespace 'System.IO' (are you missing an assembly reference?)
[英]The type or namespace name `Xml' does not exist in the namespace `System.Security.Cryptography'
我必須閱讀帶有
Using System.Security;
System.Security.Cryptography.Xml.SignedXml signedXml = new System.Security.Cryptography.Xml.SignedXml(lic);
First Unity / VS抱怨說
VS>錯誤11類型或名稱空間名稱
Xml' does not exist in the namespace
System.Security.Cryptography'Xml' does not exist in the namespace
。 您是否缺少裝配參考?
所以我在Visual Studio(C:\\ Windows \\ Microsoft.NET \\ Framework \\ v2.0.50727 \\ System.Security.dll)中添加了對System.Security的引用...但是Unity一直抱怨
錯誤CS0234:類型或名稱空間名稱
Xml' does not exist in the namespace
System.Security.Cryptography'Xml' does not exist in the namespace
。 您是否缺少裝配參考?
然后,我嘗試直接在資產文件夾中復制“ System.Security.dll” ...但仍然是相同的消息!
請問我做錯了什么? 必須做什么? 非常感謝!
單位的默認.Net 2.0 Subset
API排除了大多數System.Security.Cryptography
命名空間。 .Xml
很可能也被剝離了。 因此,請執行以下任一操作:
player settings
。 在檢查器中找到“ API Compatability Level
,默認情況下將其設置為.Net 2.0 Subset
。 將其更改為.Net 2.0
,其中包括以前剝離的其余類/命名空間。 這是單位的Subset
API排除的內容: https : //docs.unity3d.com/412/Documentation/ScriptReference/MonoCompatibility.html
抱歉,我找不到此文檔的當前版本
編輯:
按照@ user2737085的建議-您還必須將mcs.rsp
文件添加到Assets
文件夾中。 mcs.rsp
應該是包含以下行的文本文件:
-r:System.Security.dll
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.