![](/img/trans.png)
[英].NET Core SDK installed, but .NET Core VS2015 won't install? Is it required?
[英]Why .NET Core (dnxcore50) xUnit Tests are not visible in VS2015 Test Explorer?
我知道這個問題被多次詢問,但由於.NET Core的許多變化,它們已經過時了。
我有一個簡單的.NET Core庫,目標是Core(不是完整的.NET),現在我想為它配置Tests項目。
兩個項目編譯都沒有問題,但我無法在Visual Studio 2015中的測試資源管理器中顯示測試 。
下面是我設法從多個文檔源匯編的project.json文件。
你看到什么遺失,也許是一些依賴?
===================
我在用 :
MyProject.dll
project.json
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": "dnxcore50"
}
}
}
MyProject.Tests.dll
project.json
{
"version": "1.0.0-*",
"dependencies": {
"xunit.runner.dnx": "2.1.0-rc1-build204",
"MyProject": "1.0.0-*",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
},
"xunit": "2.2.0-beta4-build3444"
},
"frameworks": {
"netcoreapp1.0": {
"imports": "dnxcore50"
}
}
}
在我的特定情況下(至少我沒有從VS或控制台啟動測試的問題)xunit相關的依賴關系如下所示:
"dotnet-test-xunit": "2.2.0-preview2-build1029",
"xunit": "2.2.0-beta2-build3300",
"xunit.extensibility.execution": "2.2.0-beta2-build3300",
"xunit.runner.visualstudio": "2.2.0-beta2-build1149",
不要注意特定版本。 我相信xunit.runner.visualstudio包是你需要的
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.