【问题标题】:VSTS No test is availableVSTS 没有可用的测试
【发布时间】:2017-11-20 09:05:14
【问题描述】:

我是第一次使用 Visual Studio Team Services,并且正在设置一个带有 MSTest 项目的 C# 类库的简单场景。我想设置自动构建,它也执行测试。但是,这是行不通的。我已经搜索了很多,大多数问题似乎与 NUnit 等不同的测试适配器有关。这里不是这种情况,因为我只是使用默认的测试框架。

谁能帮助我,让我知道我错过了什么步骤或做错了什么?

唯一的消息是“警告:在...中没有可用的测试”,其中包含很多引用的 dll。


这是完整的日志:

2017-11-20T08:43:16.5294822Z ##[section]开始:VsTest - testAssemblies 2017-11-20T08:43:16.5294822Z ======================================= ======================================= 2017-11-20T08:43:16.5294822Z 任务:Visual Studio 测试 2017-11-20T08:43:16.5294822Z 描述:使用 Visual Studio 测试运行程序运行测试 2017-11-20T08:43:16.5294822Z 版本:2.2.3 2017-11-20T08:43:16.5294822Z 作者:微软公司 2017-11-20T08:43:16.5294822Z 帮助:More Information 2017-11-20T08:43:16.5294822Z ======================================= ======================================= 2017-11-20T08:43:17.5500059Z 使用 vstest.console.exe 在本地运行测试 2017-11-20T08:43:17.5500059Z ======================================== ================= 2017-11-20T08:43:17.5520059Z 测试选择器:测试组件 2017-11-20T08:43:17.5520059Z 测试程序集:**\*test*.dll,!**\obj\** 2017-11-20T08:43:17.5520059Z 测试过滤条件:空 2017-11-20T08:43:17.5530063Z 搜索文件夹:d:\a\1\s 2017-11-20T08:43:17.5540068Z 运行设置文件:d:\a\1\s 2017-11-20T08:43:17.5540068Z 并行运行:假 2017-11-20T08:43:17.5540068Z 隔离运行:假 2017-11-20T08:43:17.5592822Z 自定义适配器的路径:d:\a\1\s 2017-11-20T08:43:17.5592822Z 其他控制台选项:空 2017-11-20T08:43:17.5600072Z 代码覆盖启用:false 2017-11-20T08:43:17.5610070Z 选择用于测试执行的 VisualStudio 版本:最新 2017-11-20T08:43:17.9153146Z ======================================= ================= 2017-11-20T08:43:18.1313359Z [命令]“C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe”@d: \a_temp\dafe1090-cdce-11e7-9191-978614a9beba.txt 2017-11-20T08:43:18.3163422Z Microsoft (R) 测试执行命令行工具版本 15.0.26929.2 2017-11-20T08:43:18.3163422Z 版权所有 (c) Microsoft Corporation。版权所有。 2017-11-20T08:43:18.3173423Z 2017-11-20T08:43:18.3173423Z vstest.console.exe 2017-11-20T08:43:18.3173423Z "d:\a\1\s\ConsoleApp1\CommonTestDotNetCore\bin\Release\netcoreapp2.0\Common_Core.test.dll" 2017-11-20T08:43:18.3173423Z "d:\a\1\s\ConsoleApp1\CommonTestDotNetCore\bin\Release\netcoreapp2.0\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll" 2017-11-20T08:43:18.3173423Z "d:\a\1\s\ConsoleApp1\CommonTestDotNetCore\bin\Release\netcoreapp2.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll" 2017-11-20T08:43:18.3173423Z "d:\a\1\s\ConsoleApp1\CommonTestDotNetCore\bin\Release\netcoreapp2.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll" 2017-11-20T08:43:18.3173423Z "d:\a\1\s\TestSolution\LibraryTests\bin\Release\LibraryTests.dll" 2017-11-20T08:43:18.3173423Z "d:\a\1\s\TestSolution\LibraryTests\bin\Release\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll" 2017-11-20T08:43:18.3173423Z "d:\a\1\s\TestSolution\LibraryTests\bin\Release\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll" 2017-11-20T08:43:18.3173423Z "d:\a\1\s\TestSolution\LibraryTests\bin\Release\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll" 2017-11-20T08:43:18.3173423Z "d:\a\1\s\TestSolution\LibraryTests\bin\Release\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll" 2017-11-20T08:43:18.3173423Z "d:\a\1\s\TestSolution\LibraryTests\bin\Release\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" 2017-11-20T08:43:18.3173423Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll" 2017-11-20T08:43:18.3173423Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll" 2017-11-20T08:43:18.3173423Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll" 2017-11-20T08:43:18.3173423Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" 2017-11-20T08:43:18.3183421Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\cs\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" 2017-11-20T08:43:18.3183421Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\cs\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" 2017-11-20T08:43:18.3183421Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\cs\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" 2017-11-20T08:43:18.3183421Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\de\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" 2017-11-20T08:43:18.3183421Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\de\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" 2017-11-20T08:43:18.3183421Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\de\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" 2017-11-20T08:43:18.3183421Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\es\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" 2017-11-20T08:43:18.3183421Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\es\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" 2017-11-20T08:43:18.3183421Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\es\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" 2017-11-20T08:43:18.3183421Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\fr\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" 2017-11-20T08:43:18.3183421Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\fr\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" 2017-11-20T08:43:18.3183421Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\fr\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" 2017-11-20T08:43:18.3183421Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\it\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" 2017-11-20T08:43:18.3193424Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\it\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" 2017-11-20T08:43:18.3193424Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\it\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" 2017-11-20T08:43:18.3193424Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\ja\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" 2017-11-20T08:43:18.3193424Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\ja\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" 2017-11-20T08:43:18.3193424Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\ja\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" 2017-11-20T08:43:18.3203422Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\ko\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" 2017-11-20T08:43:18.3203422Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\ko\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" 2017-11-20T08:43:18.3203422Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\ko\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" 2017-11-20T08:43:18.3203422Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\pl\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" 2017-11-20T08:43:18.3203422Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\pl\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" 2017-11-20T08:43:18.3203422Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\pl\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" 2017-11-20T08:43:18.3203422Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\pt\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" 2017-11-20T08:43:18.3203422Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\pt\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" 2017-11-20T08:43:18.3203422Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\pt\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" 2017-11-20T08:43:18.3203422Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\ru\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" 2017-11-20T08:43:18.3203422Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\ru\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" 2017-11-20T08:43:18.3203422Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\ru\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" 2017-11-20T08:43:18.3203422Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\tr\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" 2017-11-20T08:43:18.3203422Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\tr\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" 2017-11-20T08:43:18.3203422Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\tr\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" 2017-11-20T08:43:18.3203422Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources。 dll" 2017-11-20T08:43:18.3213426Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources。 dll" 2017-11-20T08:43:18.3213426Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" 2017-11-20T08:43:18.3213426Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources。 dll" 2017-11-20T08:43:18.3213426Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources。 dll" 2017-11-20T08:43:18.3213426Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" 2017-11-20T08:43:18.3213426Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build\netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll" 2017-11-20T08:43:18.3213426Z "d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build\uap10.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll" 2017-11-20T08:43:18.3213426Z "d:\a\1\s\TestSolution\packages\MSTest.TestFramework.1.1.18\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll" 2017-11-20T08:43:18.3213426Z "d:\a\1\s\TestSolution\packages\MSTest.TestFramework.1.1.18\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" 2017-11-20T08:43:18.3213426Z "d:\a\1\s\TestSolution\packages\MSTest.TestFramework.1.1.18\lib\netstandard1.0\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll" 2017-11-20T08:43:18.3213426Z "d:\a\1\s\TestSolution\packages\MSTest.TestFramework.1.1.18\lib\netstandard1.0\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" 2017-11-20T08:43:18.3213426Z "d:\a\1\s\TestSolution\packages\MSTest.TestFramework.1.1.18\lib\uap10.0\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll" 2017-11-20T08:43:18.3213426Z "d:\a\1\s\TestSolution\packages\MSTest.TestFramework.1.1.18\lib\uap10.0\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" 2017-11-20T08:43:18.3213426Z /记录器:“trx” 2017-11-20T08:43:18.3213426Z /TestAdapterPath:"d:\a\1\s" 2017-11-20T08:43:19.0238269Z 开始测试执行,请稍候... 2017-11-20T08:43:22.1177350Z 警告: d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\tr\Microsoft 中没有可用的测试.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\tr\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\ru\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll d:\a\1\s\TestSolution\packages\MSTest .TestAdapter.1.1.18\build_common\ru\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\ru\Microsoft .VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\pt\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter。 1.1.18\build_common\pt\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\tr\Microsoft.VisualStudio。 TestPlatform.TestFramework.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\pl\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll d:\a\1\ s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\pl\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1。 18\build_common\pl\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\pt\Microsoft.VisualStudio.TestPlatform。 TestFramework.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll d:\a\ 1\s\TestSolution\packages\MSTest.Test Adapter.1.1.18\build_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\ko\Microsoft。 VisualStudio.TestPlatform.TestFramework.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll d :\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll d:\a\1\s\TestSolution\ packages\MSTest.TestAdapter.1.1.18\build_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build\ netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build\uap10.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter。 PlatformServices.dll d:\a\1\s\TestSolution\pac kages\MSTest.TestFramework.1.1.18\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll d:\a\1\s\TestSolution\packages\MSTest.TestFramework.1.1.18\lib\netstandard1.0\ Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll d:\a\1\s\TestSolution\packages\MSTest.TestFramework.1.1.18\lib\netstandard1.0\Microsoft.VisualStudio.TestPlatform.TestFramework.dll d:\ a\1\s\TestSolution\packages\MSTest.TestFramework.1.1.18\lib\uap10.0\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll d:\a\1\s\TestSolution\packages\MSTest。 TestFramework.1.1.18\lib\uap10.0\Microsoft.VisualStudio.TestPlatform.TestFramework.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\zh-Hans\Microsoft。 VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll d:\a\1\s\ConsoleApp1\CommonTestDotNetCore\bin\Release\netcoreapp2.0\Common_Core.test.dll d:\a\1\s\TestSolution\packages\ MSTest.TestAdapter.1.1.18\build_common\ko\Microsoft.VisualStudio.TestPlatform.MSTestAda pter.PlatformServices.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\ja\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll d:\a\1\ s\ConsoleApp1\CommonTestDotNetCore\bin\Release\netcoreapp2.0\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll d:\a\1\s\ConsoleApp1\CommonTestDotNetCore\bin\Release\netcoreapp2.0\Microsoft.VisualStudio。 TestPlatform.MSTestAdapter.PlatformServices.Interface.dll d:\a\1\s\ConsoleApp1\CommonTestDotNetCore\bin\Release\netcoreapp2.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll d:\a\1\s\ TestSolution\LibraryTests\bin\Release\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll d:\a\1\s\TestSolution\LibraryTests\bin\Release\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll d :\a\1\s\TestSolution\LibraryTests\bin\Release\Microsoft.VisualStudio.TestPlatform.TestFramework.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\Microso ft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll d:\ a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\Microsoft.VisualStudio.TestPlatform.TestFramework.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\ build_common\cs\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\ko\Microsoft.VisualStudio.TestPlatform.MSTest。 TestAdapter.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\cs\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll d:\a\1\ s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\de\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1。 18\build_common\ja\Microsoft.VisualStud io.TestPlatform.MSTestAdapter.PlatformServices.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\ja\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll :\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\it\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll d:\a\1\s\TestSolution\packages\MSTest。 TestAdapter.1.1.18\build_common\it\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\it\Microsoft。 VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\cs\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll d:\ a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\fr\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter。 1.1.18\build_common\fr\Microsoft.VisualS tudio.TestPlatform.MSTest.TestAdapter.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\es\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll d:\ a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\es\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll d:\a\1\s\TestSolution\packages\MSTest。 TestAdapter.1.1.18\build_common\es\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\de\Microsoft。 VisualStudio.TestPlatform.TestFramework.resources.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\de\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll d:\ a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\fr\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll d:\a\1\s\TestSolution\packages\MSTest。 TestFramework.1.1.18\lib\net45\M icrosoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll d:\a\1\s\TestSolution\LibraryTests\bin\Release\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll d:\a\1\s\TestSolution\ LibraryTests\bin\Release\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll d:\a\1\s\TestSolution\packages\MSTest.TestAdapter.1.1.18\build_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices。 dll d:\a\1\s\TestSolution\LibraryTests\bin\Release\LibraryTests.dll。 确保已安装的测试发现器和执行器、平台和框架版本设置正确,然后重试。 2017-11-20T08:43:22.1237346Z 2017-11-20T08:43:22.1237346Z 2017-11-20T08:43:22.2437321Z 信息:此外,如果测试发现器和执行器作为 vsix 扩展安装在机器上并且您的安装支持 vsix 扩展,您可以尝试指定“/UseVsixExtensions”命令。示例:vstest.console.exe myTests.dll /UseVsixExtensions:true 2017-11-20T08:43:22.2437321Z 2017-11-20T08:43:28.4823923Z ##[警告]没有找到要发布的结果。 2017-11-20T08:43:28.4863923Z ##[section]完成:VsTest - testAssemblies


编辑:dotnet 测试结果:

这些是 dotnet 测试的结果:

2017-11-23T09:16:25.4507466Z ##[section]开始:dotnet test 2017-11-23T09:16:25.4517463Z ======================================== ======================================= 2017-11-23T09:16:25.4517463Z 任务:.NET Core 2017-11-23T09:16:25.4517463Z 描述:构建、测试、打包或发布 dotnet 应用程序,或运行自定义 dotnet 命令。对于包命令,支持 NuGet.org 和经过身份验证的源,如包管理和 MyGet。 2017-11-23T09:16:25.4517463Z 版本:2.1.8 2017-11-23T09:16:25.4517463Z 作者:微软公司 2017-11-23T09:16:25.4517463Z 帮助:More Information 2017-11-23T09:16:25.4517463Z ======================================== ======================================= 2017-11-23T09:16:26.4307767Z [command]"C:\Program Files\dotnet\dotnet.exe" test --configuration release --logger trx --results-directory d:\a_temp 2017-11-23T09:16:35.5529647Z MSBUILD:错误 MSB1003:指定项目或解决方案文件。当前工作目录不包含项目或解决方案文件。 2017-11-23T09:16:35.5799660Z ##[错误]错误:C:\Program Files\dotnet\dotnet.exe 失败,返回码:1 2017-11-23T09:16:35.5849659Z ##[警告]没有找到测试结果文件。 2017-11-23T09:16:35.5879662Z ##[error]Dotnet 命令在以下项目中以非零退出代码失败: 2017-11-23T09:16:35.5979646Z ##[section]整理:dotnet 测试

【问题讨论】:

  • 你用我的解决方案解决了这个问题吗?
  • 我有同样的问题,但尚未使用此线程中建议的解决方案解决。 :(

标签: unit-testing automated-tests azure-devops azure-pipelines


【解决方案1】:

这是一个.Net Core测试,所以你可以通过.Net Core任务运行测试(版本:2.*;命令:test;参数:--configuration $(BuildConfiguration);检查发布测试结果选项)。

如果您使用的是1.* 版本的.Net Core 任务:

  1. 指定此参数:--configuration $(BuildConfiguration) --logger "trx"
  2. 添加发布测试结果任务(测试结果格式:VSTest;测试结果文件:**\*.trx;搜索文件夹:$(System.DefaultWorkingDirectory)

您也可以通过 Visual Studio 测试任务来完成:

【讨论】:

  • 不幸的是,这不起作用...在我的问题中添加了 dotnet 测试的结果(对于评论部分来说太长了)
  • 顺便说一句,我在这个版本中有两个测试项目,一个 .NET Core 2.0 和一个“普通”.NET Framework 测试项目(我希望能够同时使用这两个选项)。两个测试项目都不起作用...
  • 使用第二个选项,我至少从我的 .NET Core 测试项目中获得了一些测试结果!惊人的!虽然它仍然无法构建(虽然测试都通过了)......我会调查这个并回复你。您对如何让“标准”.NET 单元测试正常工作有什么建议吗?
  • 这是 .NET Core 测试的测试结果:2017-11-23T09:40:42.3174780Z 测试运行失败。 2017-11-23T09:40:42.3194767Z 测试执行时间:12.3926 秒 2017-11-23T09:40:42.3554763Z 结果文件:d:\a\1\s\TestResults\buildguest_factoryvm-az248_2017-11-23_09_40_41.trx 201 -11-23T09:40:46.9246800Z ##[warning]Vstest 因错误而失败。检查失败的日志。可能有失败的测试。 2017-11-23T09:40:46.9246800Z ##[error]Error: C:\Program Files (x86)\...\TestPlatform\vstest.console.exe 失败,返回码:1 2017-11-23T09:40 :48.1249967Z ##[error]VsTest 任务失败。
  • Dotnet测试任务需要指定核心项目(如*/*coretest.csproj)。对于多种类型的测试项目,您可能会添加额外的Visual Studio测试任务来单独运行它们,但找不到一起运行它们的方法。关于 .Net Core 测试失败问题,我建议在新的论坛主题中提出单独的问题。因此,论坛读者可以很容易地识别问题和答案。您需要在新线程中提供详细日志(将 system.debug 变量设置为 true,然后进行队列构建)。
【解决方案2】:

对于那些通过网络搜索来到这里的人,我收到了相同的错误消息,但不是在 VSTS 中或使用 .NET Core。问题是我的测试项目的“平台目标”与被测项目不匹配。这可以在以下位置进行修改:

项目属性 -> 常规 -> 平台目标

这会针对给定的构建配置(调试/发布/等)修改 MSBuild 文件/项目文件中的节点。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-02-15
    • 2010-12-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多