2017-08-17 34 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定義了一個依賴項」 –