Azure devops VST中未发现.NET Core 2.0 xUnit测试

Azure devops VST中未发现.NET Core 2.0 xUnit测试,azure-devops,xunit,Azure Devops,Xunit,我正在尝试建立VSTS与.NETCore2.0项目和xUnit的持续集成 我已经安装了xunit.runner.visualstudio NuGet软件包,并且在Visual Studio中一切正常 VST找不到任何要运行的测试 到目前为止,我能找到的是,它描述了如何使用project.json在.NETCore1.0中进行设置。不幸的是,这行不通,因为project.json已经在.NETCore2.0中消失了 有什么建议吗 VSTS输出: 2017-11-08T20:00:30.482498

我正在尝试建立VSTS与.NETCore2.0项目和xUnit的持续集成

我已经安装了xunit.runner.visualstudio NuGet软件包,并且在Visual Studio中一切正常

VST找不到任何要运行的测试

到目前为止,我能找到的是,它描述了如何使用project.json在.NETCore1.0中进行设置。不幸的是,这行不通,因为project.json已经在.NETCore2.0中消失了

有什么建议吗

VSTS输出:

2017-11-08T20:00:30.4824989Z###[部分]开始:VsTest- 测试组件2017-11-08T20:00:30.4834988Z ===========================================================================================================================2017-11-08T20:00:30.4834988Z任务:Visual Studio测试 2017-11-08T20:00:30.4834988Z说明:使用可视化工具运行测试 Studio test runner 2017-11-08T20:00:30.4834988Z版本:2.2.3 2017-11-08T20:00:30.4834988Z作者:微软公司 2017-11-08T20:00:30.4834988Z帮助: 2017-11-08T20:00:30.4834988Z ===============================================================================================================2017-11-08T20:00:31.2064989Z使用在本地运行测试 vstest.console.exe 2017-11-08T20:00:31.2064989Z =============================================================2017-11-08T20:00:31.2074983Z测试选择器:测试组件 2017-11-08T20:00:31.2084986Z测试组件: \release*test*.dll,\release\netcoreapp2.0*Unit*.dll,-:\xunit.runner.visualstudio.testadapter.dll\obj** 2017-11-08T20:00:31.2084986Z测试筛选标准:空 2017-11-08T20:00:31.2094992Z搜索文件夹:d:\a\1\s 2017-11-08T20:00:31.2094992Z运行设置文件:d:\a\1\s 2017-11-08T20:00:31.2094992Z并行运行:false 2017-11-08T20:00:31.2115263Z隔离运行:false 2017-11-08T20:00:31.2184982Z自定义适配器路径:空 2017-11-08T20:00:31.2194992Z其他控制台选项:空 2017-11-08T20:00:31.2194992Z代码覆盖率启用:错误 2017-11-08T20:00:31.2205509Z VisualStudio版本已选择进行测试 执行时间:最新2017-11-08T20:00:32.3430734Z ==========================================================2017-11-08T20:00:38.4660600Z[命令]“C:\Program Files (x86)\Microsoft Visual Studio Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe“ @d:\a_temp\7a0ab851-c4bf-11e7-9264-0bc93cd5677b.txt 2017-11-08T20:00:38.6420650Z Microsoft(R)测试执行命令行 工具版本15.0.26929.2 2017-11-08T20:00:38.6420650Z版权所有(c) 微软公司。版权所有。 2017-11-08T20:00:38.6420650Z 2017-11-08T20:00:38.6420650Z vstest.console.exe 2017-11-08T20:00:38.6430604Z “d:\a\1\s\Salgsapp\MyTestProject.Business.Unit\bin\Release\netcoreapp2.0\MyTestProject.Business.Unit.dll” 2017-11-08T20:00:38.6430604Z “d:\a\1\s\Salgsapp\MyTestProject.Business.Unit\bin\Release\netcoreapp2.0\xunit.runner.reporters.netcoreapp10.dll” 2017-11-08T20:00:38.6430604Z “d:\a\1\s\Salgsapp\MyTestProject.Business.Unit\bin\Release\netcoreapp2.0\xunit.runner.utility.netcoreapp10.dll” 2017-11-08T20:00:38.6430604Z “d:\a\1\s\Salgsapp\MyTestProject.Business.Unit\bin\Release\netcoreapp2.0\xunit.runner.visualstudio.dotnetcore.testadapter.dll” 2017-11-08T20:00:38.6430604Z/记录器:“trx” 2017-11-08T20:00:38.6430604Z/TestAdapterPath:“d:\a\1\s” 2017-11-08T20:00:39.2010599Z开始执行测试,请稍候。。。 2017-11-08T20:00:39.7672139Z警告:没有可用的测试 d:\a\1\s\Salgsapp\MyTestProject.Business.Unit\bin\Release\netcoreapp2.0\MyTestProject.Business.Unit.dll d:\a\1\s\Salgsapp\MyTestProject.Business.Unit\bin\Release\netcoreapp2.0\xunit.runner.reporters.netcoreapp10.dll d:\a\1\s\Salgsapp\MyTestProject.Business.Unit\bin\Release\netcoreapp2.0\xunit.runner.utility.netcoreapp10.dll d:\a\1\s\Salgsapp\MyTestProject.Business.Unit\bin\Release\netcoreapp2.0\xunit.runner.visualstudio.dotnetcore.testadapter.dll。 确保已安装的测试发现者和执行者、平台& 框架版本设置正确,请重试。 2017-11-08T20:00:39.7682139Z 2017-11-08T20:00:39.7812142Z 2017-11-08T20:00:40.6140742Z信息:此外,您可以尝试 如果测试发现者& executor作为vsix扩展和您的 安装支持vsix扩展。示例:vstest.console.exe myTests.dll/usevsixtensions:true 2017-11-08T20:00:40.6140742Z 2017-11-08T20:00:43.0551327Z###[警告]未找到要发布的结果。 2017-11-08T20:00:43.0711309Z###[章节]整理:VsTest- 测试组件

项目定义:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>

    <IsPackable>false</IsPackable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0-preview-20170628-02" />
    <PackageReference Include="Moq">
      <Version>4.7.142</Version>
    </PackageReference>
    <PackageReference Include="MSTest.TestAdapter" Version="1.1.18" />
    <PackageReference Include="MSTest.TestFramework" Version="1.1.18" />
    <PackageReference Include="xunit">
      <Version>2.3.1</Version>
    </PackageReference>
    <PackageReference Include="xunit.runner.visualstudio">
      <Version>2.3.1</Version>
    </PackageReference>
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\MyTestProject.Business\MyTestProject.Business.csproj" />
  </ItemGroup>

</Project>

netcoreapp2.0
假的
4.7.142
2.3.1
2.3.1
生成配置:


您需要在IED\Extensions\TestPlatform文件夹中指定vstest.console.exe,并在Visual Studio测试任务中指定框架选项:


你好。我试过了。似乎VST不支持该框架。收到:错误:无效的.Net Framework版本:。NETCoreApp,版本=v2.0。支持的.Net Framework版本有Framework35、Framework40和Framework45。是否指定vstest.console.exe路径?是的,您可以从pastebin@Kenci路径应该是
C:\ProgramFiles(x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\TestPlatform
,请更新生成定义并重试。这样就可以了。之前我将vstest.console.exe添加到路径中,但它应该是C:\Program Files(x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\TestPlatform