面对生成错误类型或命名空间名称"OneTimeSetUpAttribute“和"OneTimeTearDownAttribute”不存在
Xamarin.UITest-版本3.0.0 Nunit-版本2.6.4 NunitTestAdapter-版本2.0.0 Specflow -Version 2.1.0.0

发布于 2019-05-31 19:20:11
直到NUnit 3.0,OneTimeSetUpAttribute才出现。相反,您希望使用TestFixtureSetUpAttribute。
您可以在以下位置找到NUnit 2.6.4的文档:http://nunit.org/docs/2.6.4/docHome.html
发布于 2019-05-31 21:48:21
在NUnit 2.6.4中,SetUpFixture使用SetUpAttribute和TearDownAttribute。在NUnit 3中更改为OneTimeSetUpAttribute和OneTimeTearDownAttribute。@Chris提到的变化也发生了,但它影响的是TestFixture而不是SetUpFixture。
发布于 2019-12-16 21:44:50
NUnit 2.6.5中存在OneTimeSetUpAttribute,文档可以在这里找到:http://nunitsoftware.com/nunitv2/index.php?p=onetimeSetUp&r=2.6.5
因此,您可以尝试的第一件事是更新NUnit NuGet包。如果您使用的是SpecFlow,那么编辑SpecFlow生成的文件就没有意义了,因为SpecFlow会再次重新生成这些文件。
最好的办法是开始使用新的NUnit 3.x和新的SpecFlow包。
https://stackoverflow.com/questions/56393252
复制相似问题