找不到类型或名称空间名称'NUnit'|团结

问题描述 投票:1回答:1

我有下一个错误:

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?)

页面下的更多:

enter image description here

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

如何解决?

c# unity3d nunit
1个回答
0
投票

测试代码必须在编辑器下,因此它可以编译为Assembly-CSharp-Editor-*。dll,该文件具有对nunit dll的引用。

我发现这特别令人困惑,因为对Assembly-CSharp-*。csproj进行了快速检查,它将显示nunit.framework作为参考,并且如果您将msbuild指向vscode中生成的解决方案,它也会生成。同时使Unity“刷新”失败)。

© www.soinside.com 2019 - 2024. All rights reserved.