2017-08-17 33 views
-1

我是新来的编程和学习C#中使用xamarin 我试图做单元测试,但得到这个错误:NUnit的错误

'TestFixtureAttribute' is obsolete:'The NUnit framework shipped with Mono is deprecated and will be removed in a future release. it was based on NUnit 2.4 which is long outdated. Please move to the NUnit NuGet package or some other form of acquiring NUnit.'

感谢

+0

请复制错误的文本在您的问题中。不是它的图像。 –

回答

1

好像你需要改变TextFixtureAttribute你参考。 Mono本身包含了NUnit 2.4,所以你仍然可以访问该引用,但是由于错误说它已经过时。如果您使用的是Visual Studio,您可以通过右键单击您的项目并单击管理NuGet软件包来安装新版本的NUnit。

在那里搜索NUnit并安装软件包。然后将您正在使用的引用更新为新的NUnit引用。 (您可能必须在您的文件顶部更改您的使用语句。)

+0

谢谢。我使用Xamarin,当我尝试通过添加NuGet包添加NUnit时,我得到错误信息:“Nunit已经为NETStandard.Library定义了一个依赖项” –