簡體   English   中英

找不到類型或命名空間名稱“NUnit”| 統一

[英]The type or namespace name 'NUnit' could not be found | Unity

我有下一個錯誤:

The type or namespace name 'NUnit' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'UnitySetUpAttribute' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'UnitySetUp' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'TestAttribute' could not be found (are you missing a using directive or an assembly reference?)

更多下一個頁面:

在此處輸入圖像描述

代碼: https://pastebin.com/5zTjwPZw

怎么修?

測試代碼需要在編輯器下,因此它編譯為 Assembly-CSharp-Editor-*.dll 引用了 nunit dll。

我發現這特別令人困惑,因為快速檢查 Assembly-CSharp-*.csproj 將顯示作為參考列出的 nunit.framework,並且如果您將 msbuild 指向 vscode 中生成的解決方案,它也會構建(同時失敗Unity“刷新”)。

更新到 2020.2.3f1 后,我在自定義 package中遇到了同樣的問題

對於包(或者如果您正在使用程序集),它們現在似乎強制編輯器的唯一程序集應該在檢查器的平台部分中標記為:

在此處輸入圖像描述

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM