VS Test failing in Pipelines with missing 'Microsoft.NET.Test.Sdk'










0















I'm getting a failed builds due to the Visual Studio Test step failing in my Build Pipeline.



I have a simple .NET Core v2.1 class library and associated MS Test library. I have 2 steps in my pipeline:



  1. A .NET Core build step, and

  2. A Visual Studio Test step

Both projects target the netcoreapp2.1 framework, see below for .csproj files.



I have tried enabling and disabling the Code coverage option, but this make no difference.



Thanks in advance,



Kaine




.csproj files



Main Project






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

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AssemblyName>Trustmarque.Core.ExtensionMethods</AssemblyName>
<RootNamespace>Trustmarque.Core.ExtensionMethods</RootNamespace>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>Generalised class extension methods build on the .NET Core.</Description>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
</ItemGroup>

</Project>





Test Project






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

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>

<IsPackable>false</IsPackable>

<AssemblyName>Trustmarque.Core.ExtensionMethods.Tests</AssemblyName>

<RootNamespace>Trustmarque.Core.ExtensionMethods.Tests</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..ExtensionMethodsExtensionMethods.csproj" />
</ItemGroup>

</Project>






YAML






queue:
name: Hosted VS2017
demands: vstest

steps:
- task: DotNetCoreCLI@2
displayName: '.NET Core Build'


- task: VSTest@2
displayName: 'VS Unit Test'
inputs:
testFiltercriteria: /diag

codeCoverageEnabled: true

otherConsoleOptions: '/framework:".NETCoreApp,Version=2.1"'






Test Output Log






2018-11-14T09:33:56.0414482Z ##[section]Starting: VS Unit Test
2018-11-14T09:33:56.0420823Z ==============================================================================
2018-11-14T09:33:56.0420887Z Task : Visual Studio Test
2018-11-14T09:33:56.0420941Z Description : Run unit and functional tests (Selenium, Appium, Coded UI test, etc.) using the Visual Studio Test (VsTest) runner. Test frameworks that have a Visual Studio test adapter such as MsTest, xUnit, NUnit, Chutzpah (for JavaScript tests using QUnit, Mocha and Jasmine), etc. can be run. Tests can be distributed on multiple agents using this task (version 2).
2018-11-14T09:33:56.0420983Z Version : 2.142.12
2018-11-14T09:33:56.0421033Z Author : Microsoft Corporation
2018-11-14T09:33:56.0421089Z Help : [More information](https://go.microsoft.com/fwlink/?LinkId=835764)
2018-11-14T09:33:56.0421126Z ==============================================================================
2018-11-14T09:33:56.9036862Z SystemVssConnection exists true
2018-11-14T09:33:57.0359241Z SystemVssConnection exists true
2018-11-14T09:33:57.1181619Z Running tests using vstest.console.exe runner.
2018-11-14T09:33:57.1181728Z ======================================================
2018-11-14T09:33:57.1182048Z Test selector : Test assemblies
2018-11-14T09:33:57.1182141Z Test filter criteria : null
2018-11-14T09:33:57.1182212Z Search folder : D:a1s
2018-11-14T09:33:57.1182743Z VisualStudio version selected for test execution : latest
2018-11-14T09:33:57.8312901Z Run in parallel : false
2018-11-14T09:33:57.8314015Z Run in isolation : false
2018-11-14T09:33:57.8315114Z Path to custom adapters : null
2018-11-14T09:33:57.8319882Z Other console options : /framework:".NETCoreApp,Version=2.1"
2018-11-14T09:33:57.8320427Z Code coverage enabled : true
2018-11-14T09:33:57.8320689Z Diagnostics enabled : false
2018-11-14T09:33:57.8322155Z SystemVssConnection exists true
2018-11-14T09:33:57.8348561Z Run the tests locally using vstest.console.exe
2018-11-14T09:33:57.8348848Z ========================================================
2018-11-14T09:33:57.8349439Z Test selector : Test assemblies
2018-11-14T09:33:57.8352816Z Test assemblies : ***test*.dll,!***TestAdapter.dll,!**obj**
2018-11-14T09:33:57.8353669Z Test filter criteria : null
2018-11-14T09:33:57.8360790Z Search folder : D:a1s
2018-11-14T09:33:57.8361971Z Run settings file : D:a1s
2018-11-14T09:33:57.8369736Z Run in parallel : false
2018-11-14T09:33:57.8370326Z Run in isolation : false
2018-11-14T09:33:57.8392182Z Path to custom adapters : null
2018-11-14T09:33:57.8393171Z Other console options : /framework:".NETCoreApp,Version=2.1"
2018-11-14T09:33:57.8395168Z Code coverage enabled : true
2018-11-14T09:33:57.8396140Z Diagnostics enabled : false
2018-11-14T09:33:57.8398717Z Rerun failed tests: false
2018-11-14T09:33:57.8401805Z VisualStudio version selected for test execution : latest
2018-11-14T09:33:58.9933609Z ========================================================
2018-11-14T09:33:58.9973631Z ======================================================
2018-11-14T09:33:59.0613609Z [command]"C:Program Files (x86)Microsoft Visual Studio2017EnterpriseCommon7IDECommonExtensionsMicrosoftTestWindowvstest.console.exe" @D:a_temp69e3bc61-e7f0-11e8-8572-4338aa006dd6.txt
2018-11-14T09:34:06.3128046Z Microsoft (R) Test Execution Command Line Tool Version 15.8.0
2018-11-14T09:34:06.3130539Z Copyright (c) Microsoft Corporation. All rights reserved.
2018-11-14T09:34:06.3131113Z
2018-11-14T09:34:06.6145727Z vstest.console.exe
2018-11-14T09:34:06.6146432Z "D:a1sExtensionMethods.TestsbinDebugnetcoreapp2.1Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll"
2018-11-14T09:34:06.6147591Z "D:a1sExtensionMethods.TestsbinDebugnetcoreapp2.1Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll"
2018-11-14T09:34:06.6147793Z "D:a1sExtensionMethods.TestsbinDebugnetcoreapp2.1Trustmarque.Core.ExtensionMethods.Tests.dll"
2018-11-14T09:34:06.6149501Z /EnableCodeCoverage
2018-11-14T09:34:06.6149657Z /logger:"trx"
2018-11-14T09:34:06.6149783Z /TestAdapterPath:"D:a1s"
2018-11-14T09:34:06.6149907Z /framework:".NETCoreApp,Version=2.1"
2018-11-14T09:34:12.8077290Z Starting test execution, please wait...
2018-11-14T09:34:14.8437128Z Test run will use DLL(s) built for framework .NETCoreApp,Version=v2.1 and platform X86. Following DLL(s) do not match framework/platform settings.
2018-11-14T09:34:14.8437793Z Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll is built for Framework 4.5 and Platform AnyCPU.
2018-11-14T09:34:14.8438215Z Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll is built for Framework 1.5 and Platform AnyCPU.
2018-11-14T09:34:14.8438617Z Go to http://go.microsoft.com/fwlink/?LinkID=236877&clcid=0x409 for more details on managing these settings.
2018-11-14T09:34:14.8438786Z
2018-11-14T09:34:23.5616980Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:23.5617265Z
2018-11-14T09:34:23.5617351Z
2018-11-14T09:34:23.5617457Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:23.5617498Z
2018-11-14T09:34:23.5617554Z
2018-11-14T09:34:23.5617591Z
2018-11-14T09:34:23.5617627Z
2018-11-14T09:34:24.4903850Z 2.8847
2018-11-14T09:34:25.4504736Z System.IO.FileNotFoundException: Unable to find tests for D:a1sExtensionMethods.TestsbinDebugnetcoreapp2.1Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk" and framework version settings are appropriate. Rerun with /diag option to diagnose further.
2018-11-14T09:34:25.4504927Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo)
2018-11-14T09:34:25.4505025Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources)
2018-11-14T09:34:25.4505077Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyExecutionManager.StartTestRun(TestRunCriteria testRunCriteria, ITestRunEventsHandler eventHandler)
2018-11-14T09:34:25.6678123Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:25.6678286Z
2018-11-14T09:34:25.6678334Z
2018-11-14T09:34:25.6678492Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:25.6678566Z
2018-11-14T09:34:25.6678623Z
2018-11-14T09:34:25.6678664Z
2018-11-14T09:34:25.6678700Z
2018-11-14T09:34:26.8351769Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:26.8351940Z
2018-11-14T09:34:26.8352006Z
2018-11-14T09:34:26.8352092Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:26.8352125Z
2018-11-14T09:34:26.8352155Z
2018-11-14T09:34:26.8352199Z
2018-11-14T09:34:26.8352227Z
2018-11-14T09:34:26.8788931Z 2.3838
2018-11-14T09:34:26.8898822Z System.IO.FileNotFoundException: Unable to find tests for D:a1sExtensionMethods.TestsbinDebugnetcoreapp2.1Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk" and framework version settings are appropriate. Rerun with /diag option to diagnose further.
2018-11-14T09:34:26.8899122Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo)
2018-11-14T09:34:26.8899942Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources)
2018-11-14T09:34:26.8900007Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyExecutionManager.StartTestRun(TestRunCriteria testRunCriteria, ITestRunEventsHandler eventHandler)
2018-11-14T09:34:26.9247283Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:26.9247370Z
2018-11-14T09:34:26.9247428Z
2018-11-14T09:34:26.9247520Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:26.9247570Z
2018-11-14T09:34:26.9247619Z
2018-11-14T09:34:26.9247650Z
2018-11-14T09:34:26.9247681Z
2018-11-14T09:34:27.4568128Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:27.4568259Z
2018-11-14T09:34:27.4568335Z
2018-11-14T09:34:27.4568442Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:27.4568504Z
2018-11-14T09:34:27.4568543Z
2018-11-14T09:34:27.4568580Z
2018-11-14T09:34:27.4568631Z
2018-11-14T09:34:27.5016363Z 3.0114
2018-11-14T09:34:33.4517174Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:33.4517363Z
2018-11-14T09:34:33.4517409Z
2018-11-14T09:34:33.4517517Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:33.4517603Z
2018-11-14T09:34:33.4517641Z
2018-11-14T09:34:33.4517678Z
2018-11-14T09:34:33.4517715Z
2018-11-14T09:34:33.7048135Z Passed Timestamp_DateTime_CurrentDateTime_FormatAndValuesMatch
2018-11-14T09:34:33.7048569Z Passed ToJson_Object_ReturnsStringRepresentation
2018-11-14T09:34:33.7048660Z Passed ToJsonString_Object_ReturnsStringRepresentationIncludingObjectType
2018-11-14T09:34:33.7049036Z Passed IsNullOrEmpty_String_EmptyAndNullValues
2018-11-14T09:34:33.7049135Z Passed IsNullOrEmpty_String_NonEmptyOrNullValues
2018-11-14T09:34:33.7049190Z Passed Parse_String_ValidTypeParses_CorrectTypes
2018-11-14T09:34:33.7049257Z Passed Parse_String_ValidTypeParses_DefaultTypes
2018-11-14T09:34:33.7049297Z Passed FromJson_String_ValidObjects
2018-11-14T09:34:33.7049338Z Passed FromJson_String_InvalidObjects
2018-11-14T09:34:33.7049402Z Passed IsValidEmailAddress_String_ValidEmailAddresses_ReturnTrue
2018-11-14T09:34:33.7049465Z Passed IsValidEmailAddress_String_InvalidEmailAddresses_ReturnFalse
2018-11-14T09:34:35.8172642Z Results File: D:a1sTestResultsVssAdministrator_factoryvm-az552_2018-11-14_09_34_33.trx
2018-11-14T09:34:35.8203749Z
2018-11-14T09:34:35.8210373Z Attachments:
2018-11-14T09:34:35.8210758Z D:a1sTestResults6c92c0b5-2e35-48af-867a-2a4575306a68VssAdministrator_factoryvm-az552 2018-11-14 09_34_22.coverage
2018-11-14T09:34:35.8211079Z
2018-11-14T09:34:35.8211397Z Total tests: Unknown. Passed: 11. Failed: 0. Skipped: 0.
2018-11-14T09:34:35.8211670Z Test Run Aborted.
2018-11-14T09:34:35.8211939Z Test execution time: 10.7395 Seconds
2018-11-14T09:34:36.0240507Z ##[warning]Vstest failed with error. Check logs for failures. There might be failed tests.
2018-11-14T09:34:36.0769776Z ##[error]Error: C:Program Files (x86)Microsoft Visual Studio2017EnterpriseCommon7IDECommonExtensionsMicrosoftTestWindowvstest.console.exe failed with return code: 1
2018-11-14T09:34:36.3170630Z ##[error]VsTest task failed.
2018-11-14T09:34:36.3566464Z ##[section]Async Command Start: Publish test results
2018-11-14T09:34:36.4181634Z Publishing test results to test run '6'
2018-11-14T09:34:36.4181725Z Test results remaining: 11. Test run id: 6
2018-11-14T09:34:36.9962474Z Published Test Run : https://dev.azure.com/TrustmarqueIT/Test_2018-10-30/_TestManagement/Runs#runId=6&_a=runCharts
2018-11-14T09:34:36.9971952Z ##[section]Async Command End: Publish test results
2018-11-14T09:34:36.9972803Z ##[section]Finishing: VS Unit Test











share|improve this question






















  • Did you try to add dotnet restore task before your dotnet build in order to make sure the dependencies were installed correctly?

    – Jayendran
    Nov 15 '18 at 2:34












  • Hi @Jayendran, thanks for your suggestion. I didn't have a dotnet restore step, added it, but it still fails. Here's the YAML: resources: - repo: self queue: name: Hosted VS2017 demands: vstest steps: - task: DotNetCoreCLI@2 displayName: '.NET Core Restore' inputs: command: restore - task: DotNetCoreCLI@2 displayName: '.NET Core Build' - task: VSTest@2 displayName: 'VS Unit Test' inputs: testFiltercriteria: /diag codeCoverageEnabled: true otherConsoleOptions: '/framework:".NETCoreApp,Version=2.1"'

    – Kaine
    Nov 15 '18 at 10:43












  • Have you tried the default .NET Core build-pipeline template? Does that work without changing anything?

    – Jonathan Twite
    Nov 15 '18 at 10:55











  • Hi @JonathanTwite, I think that you are talking about the DotNetCoreCLI@2 step in the original YAML. This is the standard .NET Core build-pipeline template as far as I know. This by itself works without issue. The problem comes when I add the test step. Also, using the standard Azure Repos build template runs perfectly, but won't run the test steps as it builds on Ubuntu and the only way to add the Test step or change the vmImage is to edit the YAML, an area of expertise that I seriously lack... ;-)

    – Kaine
    Nov 15 '18 at 11:35











  • I was suggesting you try the build template (full build, not single task) provided in the DevOps front-end, rather than writing the YAML yourself - then if that works, you can compare.

    – Jonathan Twite
    Nov 15 '18 at 11:41















0















I'm getting a failed builds due to the Visual Studio Test step failing in my Build Pipeline.



I have a simple .NET Core v2.1 class library and associated MS Test library. I have 2 steps in my pipeline:



  1. A .NET Core build step, and

  2. A Visual Studio Test step

Both projects target the netcoreapp2.1 framework, see below for .csproj files.



I have tried enabling and disabling the Code coverage option, but this make no difference.



Thanks in advance,



Kaine




.csproj files



Main Project






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

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AssemblyName>Trustmarque.Core.ExtensionMethods</AssemblyName>
<RootNamespace>Trustmarque.Core.ExtensionMethods</RootNamespace>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>Generalised class extension methods build on the .NET Core.</Description>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
</ItemGroup>

</Project>





Test Project






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

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>

<IsPackable>false</IsPackable>

<AssemblyName>Trustmarque.Core.ExtensionMethods.Tests</AssemblyName>

<RootNamespace>Trustmarque.Core.ExtensionMethods.Tests</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..ExtensionMethodsExtensionMethods.csproj" />
</ItemGroup>

</Project>






YAML






queue:
name: Hosted VS2017
demands: vstest

steps:
- task: DotNetCoreCLI@2
displayName: '.NET Core Build'


- task: VSTest@2
displayName: 'VS Unit Test'
inputs:
testFiltercriteria: /diag

codeCoverageEnabled: true

otherConsoleOptions: '/framework:".NETCoreApp,Version=2.1"'






Test Output Log






2018-11-14T09:33:56.0414482Z ##[section]Starting: VS Unit Test
2018-11-14T09:33:56.0420823Z ==============================================================================
2018-11-14T09:33:56.0420887Z Task : Visual Studio Test
2018-11-14T09:33:56.0420941Z Description : Run unit and functional tests (Selenium, Appium, Coded UI test, etc.) using the Visual Studio Test (VsTest) runner. Test frameworks that have a Visual Studio test adapter such as MsTest, xUnit, NUnit, Chutzpah (for JavaScript tests using QUnit, Mocha and Jasmine), etc. can be run. Tests can be distributed on multiple agents using this task (version 2).
2018-11-14T09:33:56.0420983Z Version : 2.142.12
2018-11-14T09:33:56.0421033Z Author : Microsoft Corporation
2018-11-14T09:33:56.0421089Z Help : [More information](https://go.microsoft.com/fwlink/?LinkId=835764)
2018-11-14T09:33:56.0421126Z ==============================================================================
2018-11-14T09:33:56.9036862Z SystemVssConnection exists true
2018-11-14T09:33:57.0359241Z SystemVssConnection exists true
2018-11-14T09:33:57.1181619Z Running tests using vstest.console.exe runner.
2018-11-14T09:33:57.1181728Z ======================================================
2018-11-14T09:33:57.1182048Z Test selector : Test assemblies
2018-11-14T09:33:57.1182141Z Test filter criteria : null
2018-11-14T09:33:57.1182212Z Search folder : D:a1s
2018-11-14T09:33:57.1182743Z VisualStudio version selected for test execution : latest
2018-11-14T09:33:57.8312901Z Run in parallel : false
2018-11-14T09:33:57.8314015Z Run in isolation : false
2018-11-14T09:33:57.8315114Z Path to custom adapters : null
2018-11-14T09:33:57.8319882Z Other console options : /framework:".NETCoreApp,Version=2.1"
2018-11-14T09:33:57.8320427Z Code coverage enabled : true
2018-11-14T09:33:57.8320689Z Diagnostics enabled : false
2018-11-14T09:33:57.8322155Z SystemVssConnection exists true
2018-11-14T09:33:57.8348561Z Run the tests locally using vstest.console.exe
2018-11-14T09:33:57.8348848Z ========================================================
2018-11-14T09:33:57.8349439Z Test selector : Test assemblies
2018-11-14T09:33:57.8352816Z Test assemblies : ***test*.dll,!***TestAdapter.dll,!**obj**
2018-11-14T09:33:57.8353669Z Test filter criteria : null
2018-11-14T09:33:57.8360790Z Search folder : D:a1s
2018-11-14T09:33:57.8361971Z Run settings file : D:a1s
2018-11-14T09:33:57.8369736Z Run in parallel : false
2018-11-14T09:33:57.8370326Z Run in isolation : false
2018-11-14T09:33:57.8392182Z Path to custom adapters : null
2018-11-14T09:33:57.8393171Z Other console options : /framework:".NETCoreApp,Version=2.1"
2018-11-14T09:33:57.8395168Z Code coverage enabled : true
2018-11-14T09:33:57.8396140Z Diagnostics enabled : false
2018-11-14T09:33:57.8398717Z Rerun failed tests: false
2018-11-14T09:33:57.8401805Z VisualStudio version selected for test execution : latest
2018-11-14T09:33:58.9933609Z ========================================================
2018-11-14T09:33:58.9973631Z ======================================================
2018-11-14T09:33:59.0613609Z [command]"C:Program Files (x86)Microsoft Visual Studio2017EnterpriseCommon7IDECommonExtensionsMicrosoftTestWindowvstest.console.exe" @D:a_temp69e3bc61-e7f0-11e8-8572-4338aa006dd6.txt
2018-11-14T09:34:06.3128046Z Microsoft (R) Test Execution Command Line Tool Version 15.8.0
2018-11-14T09:34:06.3130539Z Copyright (c) Microsoft Corporation. All rights reserved.
2018-11-14T09:34:06.3131113Z
2018-11-14T09:34:06.6145727Z vstest.console.exe
2018-11-14T09:34:06.6146432Z "D:a1sExtensionMethods.TestsbinDebugnetcoreapp2.1Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll"
2018-11-14T09:34:06.6147591Z "D:a1sExtensionMethods.TestsbinDebugnetcoreapp2.1Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll"
2018-11-14T09:34:06.6147793Z "D:a1sExtensionMethods.TestsbinDebugnetcoreapp2.1Trustmarque.Core.ExtensionMethods.Tests.dll"
2018-11-14T09:34:06.6149501Z /EnableCodeCoverage
2018-11-14T09:34:06.6149657Z /logger:"trx"
2018-11-14T09:34:06.6149783Z /TestAdapterPath:"D:a1s"
2018-11-14T09:34:06.6149907Z /framework:".NETCoreApp,Version=2.1"
2018-11-14T09:34:12.8077290Z Starting test execution, please wait...
2018-11-14T09:34:14.8437128Z Test run will use DLL(s) built for framework .NETCoreApp,Version=v2.1 and platform X86. Following DLL(s) do not match framework/platform settings.
2018-11-14T09:34:14.8437793Z Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll is built for Framework 4.5 and Platform AnyCPU.
2018-11-14T09:34:14.8438215Z Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll is built for Framework 1.5 and Platform AnyCPU.
2018-11-14T09:34:14.8438617Z Go to http://go.microsoft.com/fwlink/?LinkID=236877&clcid=0x409 for more details on managing these settings.
2018-11-14T09:34:14.8438786Z
2018-11-14T09:34:23.5616980Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:23.5617265Z
2018-11-14T09:34:23.5617351Z
2018-11-14T09:34:23.5617457Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:23.5617498Z
2018-11-14T09:34:23.5617554Z
2018-11-14T09:34:23.5617591Z
2018-11-14T09:34:23.5617627Z
2018-11-14T09:34:24.4903850Z 2.8847
2018-11-14T09:34:25.4504736Z System.IO.FileNotFoundException: Unable to find tests for D:a1sExtensionMethods.TestsbinDebugnetcoreapp2.1Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk" and framework version settings are appropriate. Rerun with /diag option to diagnose further.
2018-11-14T09:34:25.4504927Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo)
2018-11-14T09:34:25.4505025Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources)
2018-11-14T09:34:25.4505077Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyExecutionManager.StartTestRun(TestRunCriteria testRunCriteria, ITestRunEventsHandler eventHandler)
2018-11-14T09:34:25.6678123Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:25.6678286Z
2018-11-14T09:34:25.6678334Z
2018-11-14T09:34:25.6678492Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:25.6678566Z
2018-11-14T09:34:25.6678623Z
2018-11-14T09:34:25.6678664Z
2018-11-14T09:34:25.6678700Z
2018-11-14T09:34:26.8351769Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:26.8351940Z
2018-11-14T09:34:26.8352006Z
2018-11-14T09:34:26.8352092Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:26.8352125Z
2018-11-14T09:34:26.8352155Z
2018-11-14T09:34:26.8352199Z
2018-11-14T09:34:26.8352227Z
2018-11-14T09:34:26.8788931Z 2.3838
2018-11-14T09:34:26.8898822Z System.IO.FileNotFoundException: Unable to find tests for D:a1sExtensionMethods.TestsbinDebugnetcoreapp2.1Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk" and framework version settings are appropriate. Rerun with /diag option to diagnose further.
2018-11-14T09:34:26.8899122Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo)
2018-11-14T09:34:26.8899942Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources)
2018-11-14T09:34:26.8900007Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyExecutionManager.StartTestRun(TestRunCriteria testRunCriteria, ITestRunEventsHandler eventHandler)
2018-11-14T09:34:26.9247283Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:26.9247370Z
2018-11-14T09:34:26.9247428Z
2018-11-14T09:34:26.9247520Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:26.9247570Z
2018-11-14T09:34:26.9247619Z
2018-11-14T09:34:26.9247650Z
2018-11-14T09:34:26.9247681Z
2018-11-14T09:34:27.4568128Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:27.4568259Z
2018-11-14T09:34:27.4568335Z
2018-11-14T09:34:27.4568442Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:27.4568504Z
2018-11-14T09:34:27.4568543Z
2018-11-14T09:34:27.4568580Z
2018-11-14T09:34:27.4568631Z
2018-11-14T09:34:27.5016363Z 3.0114
2018-11-14T09:34:33.4517174Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:33.4517363Z
2018-11-14T09:34:33.4517409Z
2018-11-14T09:34:33.4517517Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:33.4517603Z
2018-11-14T09:34:33.4517641Z
2018-11-14T09:34:33.4517678Z
2018-11-14T09:34:33.4517715Z
2018-11-14T09:34:33.7048135Z Passed Timestamp_DateTime_CurrentDateTime_FormatAndValuesMatch
2018-11-14T09:34:33.7048569Z Passed ToJson_Object_ReturnsStringRepresentation
2018-11-14T09:34:33.7048660Z Passed ToJsonString_Object_ReturnsStringRepresentationIncludingObjectType
2018-11-14T09:34:33.7049036Z Passed IsNullOrEmpty_String_EmptyAndNullValues
2018-11-14T09:34:33.7049135Z Passed IsNullOrEmpty_String_NonEmptyOrNullValues
2018-11-14T09:34:33.7049190Z Passed Parse_String_ValidTypeParses_CorrectTypes
2018-11-14T09:34:33.7049257Z Passed Parse_String_ValidTypeParses_DefaultTypes
2018-11-14T09:34:33.7049297Z Passed FromJson_String_ValidObjects
2018-11-14T09:34:33.7049338Z Passed FromJson_String_InvalidObjects
2018-11-14T09:34:33.7049402Z Passed IsValidEmailAddress_String_ValidEmailAddresses_ReturnTrue
2018-11-14T09:34:33.7049465Z Passed IsValidEmailAddress_String_InvalidEmailAddresses_ReturnFalse
2018-11-14T09:34:35.8172642Z Results File: D:a1sTestResultsVssAdministrator_factoryvm-az552_2018-11-14_09_34_33.trx
2018-11-14T09:34:35.8203749Z
2018-11-14T09:34:35.8210373Z Attachments:
2018-11-14T09:34:35.8210758Z D:a1sTestResults6c92c0b5-2e35-48af-867a-2a4575306a68VssAdministrator_factoryvm-az552 2018-11-14 09_34_22.coverage
2018-11-14T09:34:35.8211079Z
2018-11-14T09:34:35.8211397Z Total tests: Unknown. Passed: 11. Failed: 0. Skipped: 0.
2018-11-14T09:34:35.8211670Z Test Run Aborted.
2018-11-14T09:34:35.8211939Z Test execution time: 10.7395 Seconds
2018-11-14T09:34:36.0240507Z ##[warning]Vstest failed with error. Check logs for failures. There might be failed tests.
2018-11-14T09:34:36.0769776Z ##[error]Error: C:Program Files (x86)Microsoft Visual Studio2017EnterpriseCommon7IDECommonExtensionsMicrosoftTestWindowvstest.console.exe failed with return code: 1
2018-11-14T09:34:36.3170630Z ##[error]VsTest task failed.
2018-11-14T09:34:36.3566464Z ##[section]Async Command Start: Publish test results
2018-11-14T09:34:36.4181634Z Publishing test results to test run '6'
2018-11-14T09:34:36.4181725Z Test results remaining: 11. Test run id: 6
2018-11-14T09:34:36.9962474Z Published Test Run : https://dev.azure.com/TrustmarqueIT/Test_2018-10-30/_TestManagement/Runs#runId=6&_a=runCharts
2018-11-14T09:34:36.9971952Z ##[section]Async Command End: Publish test results
2018-11-14T09:34:36.9972803Z ##[section]Finishing: VS Unit Test











share|improve this question






















  • Did you try to add dotnet restore task before your dotnet build in order to make sure the dependencies were installed correctly?

    – Jayendran
    Nov 15 '18 at 2:34












  • Hi @Jayendran, thanks for your suggestion. I didn't have a dotnet restore step, added it, but it still fails. Here's the YAML: resources: - repo: self queue: name: Hosted VS2017 demands: vstest steps: - task: DotNetCoreCLI@2 displayName: '.NET Core Restore' inputs: command: restore - task: DotNetCoreCLI@2 displayName: '.NET Core Build' - task: VSTest@2 displayName: 'VS Unit Test' inputs: testFiltercriteria: /diag codeCoverageEnabled: true otherConsoleOptions: '/framework:".NETCoreApp,Version=2.1"'

    – Kaine
    Nov 15 '18 at 10:43












  • Have you tried the default .NET Core build-pipeline template? Does that work without changing anything?

    – Jonathan Twite
    Nov 15 '18 at 10:55











  • Hi @JonathanTwite, I think that you are talking about the DotNetCoreCLI@2 step in the original YAML. This is the standard .NET Core build-pipeline template as far as I know. This by itself works without issue. The problem comes when I add the test step. Also, using the standard Azure Repos build template runs perfectly, but won't run the test steps as it builds on Ubuntu and the only way to add the Test step or change the vmImage is to edit the YAML, an area of expertise that I seriously lack... ;-)

    – Kaine
    Nov 15 '18 at 11:35











  • I was suggesting you try the build template (full build, not single task) provided in the DevOps front-end, rather than writing the YAML yourself - then if that works, you can compare.

    – Jonathan Twite
    Nov 15 '18 at 11:41













0












0








0








I'm getting a failed builds due to the Visual Studio Test step failing in my Build Pipeline.



I have a simple .NET Core v2.1 class library and associated MS Test library. I have 2 steps in my pipeline:



  1. A .NET Core build step, and

  2. A Visual Studio Test step

Both projects target the netcoreapp2.1 framework, see below for .csproj files.



I have tried enabling and disabling the Code coverage option, but this make no difference.



Thanks in advance,



Kaine




.csproj files



Main Project






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

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AssemblyName>Trustmarque.Core.ExtensionMethods</AssemblyName>
<RootNamespace>Trustmarque.Core.ExtensionMethods</RootNamespace>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>Generalised class extension methods build on the .NET Core.</Description>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
</ItemGroup>

</Project>





Test Project






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

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>

<IsPackable>false</IsPackable>

<AssemblyName>Trustmarque.Core.ExtensionMethods.Tests</AssemblyName>

<RootNamespace>Trustmarque.Core.ExtensionMethods.Tests</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..ExtensionMethodsExtensionMethods.csproj" />
</ItemGroup>

</Project>






YAML






queue:
name: Hosted VS2017
demands: vstest

steps:
- task: DotNetCoreCLI@2
displayName: '.NET Core Build'


- task: VSTest@2
displayName: 'VS Unit Test'
inputs:
testFiltercriteria: /diag

codeCoverageEnabled: true

otherConsoleOptions: '/framework:".NETCoreApp,Version=2.1"'






Test Output Log






2018-11-14T09:33:56.0414482Z ##[section]Starting: VS Unit Test
2018-11-14T09:33:56.0420823Z ==============================================================================
2018-11-14T09:33:56.0420887Z Task : Visual Studio Test
2018-11-14T09:33:56.0420941Z Description : Run unit and functional tests (Selenium, Appium, Coded UI test, etc.) using the Visual Studio Test (VsTest) runner. Test frameworks that have a Visual Studio test adapter such as MsTest, xUnit, NUnit, Chutzpah (for JavaScript tests using QUnit, Mocha and Jasmine), etc. can be run. Tests can be distributed on multiple agents using this task (version 2).
2018-11-14T09:33:56.0420983Z Version : 2.142.12
2018-11-14T09:33:56.0421033Z Author : Microsoft Corporation
2018-11-14T09:33:56.0421089Z Help : [More information](https://go.microsoft.com/fwlink/?LinkId=835764)
2018-11-14T09:33:56.0421126Z ==============================================================================
2018-11-14T09:33:56.9036862Z SystemVssConnection exists true
2018-11-14T09:33:57.0359241Z SystemVssConnection exists true
2018-11-14T09:33:57.1181619Z Running tests using vstest.console.exe runner.
2018-11-14T09:33:57.1181728Z ======================================================
2018-11-14T09:33:57.1182048Z Test selector : Test assemblies
2018-11-14T09:33:57.1182141Z Test filter criteria : null
2018-11-14T09:33:57.1182212Z Search folder : D:a1s
2018-11-14T09:33:57.1182743Z VisualStudio version selected for test execution : latest
2018-11-14T09:33:57.8312901Z Run in parallel : false
2018-11-14T09:33:57.8314015Z Run in isolation : false
2018-11-14T09:33:57.8315114Z Path to custom adapters : null
2018-11-14T09:33:57.8319882Z Other console options : /framework:".NETCoreApp,Version=2.1"
2018-11-14T09:33:57.8320427Z Code coverage enabled : true
2018-11-14T09:33:57.8320689Z Diagnostics enabled : false
2018-11-14T09:33:57.8322155Z SystemVssConnection exists true
2018-11-14T09:33:57.8348561Z Run the tests locally using vstest.console.exe
2018-11-14T09:33:57.8348848Z ========================================================
2018-11-14T09:33:57.8349439Z Test selector : Test assemblies
2018-11-14T09:33:57.8352816Z Test assemblies : ***test*.dll,!***TestAdapter.dll,!**obj**
2018-11-14T09:33:57.8353669Z Test filter criteria : null
2018-11-14T09:33:57.8360790Z Search folder : D:a1s
2018-11-14T09:33:57.8361971Z Run settings file : D:a1s
2018-11-14T09:33:57.8369736Z Run in parallel : false
2018-11-14T09:33:57.8370326Z Run in isolation : false
2018-11-14T09:33:57.8392182Z Path to custom adapters : null
2018-11-14T09:33:57.8393171Z Other console options : /framework:".NETCoreApp,Version=2.1"
2018-11-14T09:33:57.8395168Z Code coverage enabled : true
2018-11-14T09:33:57.8396140Z Diagnostics enabled : false
2018-11-14T09:33:57.8398717Z Rerun failed tests: false
2018-11-14T09:33:57.8401805Z VisualStudio version selected for test execution : latest
2018-11-14T09:33:58.9933609Z ========================================================
2018-11-14T09:33:58.9973631Z ======================================================
2018-11-14T09:33:59.0613609Z [command]"C:Program Files (x86)Microsoft Visual Studio2017EnterpriseCommon7IDECommonExtensionsMicrosoftTestWindowvstest.console.exe" @D:a_temp69e3bc61-e7f0-11e8-8572-4338aa006dd6.txt
2018-11-14T09:34:06.3128046Z Microsoft (R) Test Execution Command Line Tool Version 15.8.0
2018-11-14T09:34:06.3130539Z Copyright (c) Microsoft Corporation. All rights reserved.
2018-11-14T09:34:06.3131113Z
2018-11-14T09:34:06.6145727Z vstest.console.exe
2018-11-14T09:34:06.6146432Z "D:a1sExtensionMethods.TestsbinDebugnetcoreapp2.1Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll"
2018-11-14T09:34:06.6147591Z "D:a1sExtensionMethods.TestsbinDebugnetcoreapp2.1Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll"
2018-11-14T09:34:06.6147793Z "D:a1sExtensionMethods.TestsbinDebugnetcoreapp2.1Trustmarque.Core.ExtensionMethods.Tests.dll"
2018-11-14T09:34:06.6149501Z /EnableCodeCoverage
2018-11-14T09:34:06.6149657Z /logger:"trx"
2018-11-14T09:34:06.6149783Z /TestAdapterPath:"D:a1s"
2018-11-14T09:34:06.6149907Z /framework:".NETCoreApp,Version=2.1"
2018-11-14T09:34:12.8077290Z Starting test execution, please wait...
2018-11-14T09:34:14.8437128Z Test run will use DLL(s) built for framework .NETCoreApp,Version=v2.1 and platform X86. Following DLL(s) do not match framework/platform settings.
2018-11-14T09:34:14.8437793Z Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll is built for Framework 4.5 and Platform AnyCPU.
2018-11-14T09:34:14.8438215Z Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll is built for Framework 1.5 and Platform AnyCPU.
2018-11-14T09:34:14.8438617Z Go to http://go.microsoft.com/fwlink/?LinkID=236877&clcid=0x409 for more details on managing these settings.
2018-11-14T09:34:14.8438786Z
2018-11-14T09:34:23.5616980Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:23.5617265Z
2018-11-14T09:34:23.5617351Z
2018-11-14T09:34:23.5617457Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:23.5617498Z
2018-11-14T09:34:23.5617554Z
2018-11-14T09:34:23.5617591Z
2018-11-14T09:34:23.5617627Z
2018-11-14T09:34:24.4903850Z 2.8847
2018-11-14T09:34:25.4504736Z System.IO.FileNotFoundException: Unable to find tests for D:a1sExtensionMethods.TestsbinDebugnetcoreapp2.1Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk" and framework version settings are appropriate. Rerun with /diag option to diagnose further.
2018-11-14T09:34:25.4504927Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo)
2018-11-14T09:34:25.4505025Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources)
2018-11-14T09:34:25.4505077Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyExecutionManager.StartTestRun(TestRunCriteria testRunCriteria, ITestRunEventsHandler eventHandler)
2018-11-14T09:34:25.6678123Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:25.6678286Z
2018-11-14T09:34:25.6678334Z
2018-11-14T09:34:25.6678492Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:25.6678566Z
2018-11-14T09:34:25.6678623Z
2018-11-14T09:34:25.6678664Z
2018-11-14T09:34:25.6678700Z
2018-11-14T09:34:26.8351769Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:26.8351940Z
2018-11-14T09:34:26.8352006Z
2018-11-14T09:34:26.8352092Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:26.8352125Z
2018-11-14T09:34:26.8352155Z
2018-11-14T09:34:26.8352199Z
2018-11-14T09:34:26.8352227Z
2018-11-14T09:34:26.8788931Z 2.3838
2018-11-14T09:34:26.8898822Z System.IO.FileNotFoundException: Unable to find tests for D:a1sExtensionMethods.TestsbinDebugnetcoreapp2.1Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk" and framework version settings are appropriate. Rerun with /diag option to diagnose further.
2018-11-14T09:34:26.8899122Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo)
2018-11-14T09:34:26.8899942Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources)
2018-11-14T09:34:26.8900007Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyExecutionManager.StartTestRun(TestRunCriteria testRunCriteria, ITestRunEventsHandler eventHandler)
2018-11-14T09:34:26.9247283Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:26.9247370Z
2018-11-14T09:34:26.9247428Z
2018-11-14T09:34:26.9247520Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:26.9247570Z
2018-11-14T09:34:26.9247619Z
2018-11-14T09:34:26.9247650Z
2018-11-14T09:34:26.9247681Z
2018-11-14T09:34:27.4568128Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:27.4568259Z
2018-11-14T09:34:27.4568335Z
2018-11-14T09:34:27.4568442Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:27.4568504Z
2018-11-14T09:34:27.4568543Z
2018-11-14T09:34:27.4568580Z
2018-11-14T09:34:27.4568631Z
2018-11-14T09:34:27.5016363Z 3.0114
2018-11-14T09:34:33.4517174Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:33.4517363Z
2018-11-14T09:34:33.4517409Z
2018-11-14T09:34:33.4517517Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:33.4517603Z
2018-11-14T09:34:33.4517641Z
2018-11-14T09:34:33.4517678Z
2018-11-14T09:34:33.4517715Z
2018-11-14T09:34:33.7048135Z Passed Timestamp_DateTime_CurrentDateTime_FormatAndValuesMatch
2018-11-14T09:34:33.7048569Z Passed ToJson_Object_ReturnsStringRepresentation
2018-11-14T09:34:33.7048660Z Passed ToJsonString_Object_ReturnsStringRepresentationIncludingObjectType
2018-11-14T09:34:33.7049036Z Passed IsNullOrEmpty_String_EmptyAndNullValues
2018-11-14T09:34:33.7049135Z Passed IsNullOrEmpty_String_NonEmptyOrNullValues
2018-11-14T09:34:33.7049190Z Passed Parse_String_ValidTypeParses_CorrectTypes
2018-11-14T09:34:33.7049257Z Passed Parse_String_ValidTypeParses_DefaultTypes
2018-11-14T09:34:33.7049297Z Passed FromJson_String_ValidObjects
2018-11-14T09:34:33.7049338Z Passed FromJson_String_InvalidObjects
2018-11-14T09:34:33.7049402Z Passed IsValidEmailAddress_String_ValidEmailAddresses_ReturnTrue
2018-11-14T09:34:33.7049465Z Passed IsValidEmailAddress_String_InvalidEmailAddresses_ReturnFalse
2018-11-14T09:34:35.8172642Z Results File: D:a1sTestResultsVssAdministrator_factoryvm-az552_2018-11-14_09_34_33.trx
2018-11-14T09:34:35.8203749Z
2018-11-14T09:34:35.8210373Z Attachments:
2018-11-14T09:34:35.8210758Z D:a1sTestResults6c92c0b5-2e35-48af-867a-2a4575306a68VssAdministrator_factoryvm-az552 2018-11-14 09_34_22.coverage
2018-11-14T09:34:35.8211079Z
2018-11-14T09:34:35.8211397Z Total tests: Unknown. Passed: 11. Failed: 0. Skipped: 0.
2018-11-14T09:34:35.8211670Z Test Run Aborted.
2018-11-14T09:34:35.8211939Z Test execution time: 10.7395 Seconds
2018-11-14T09:34:36.0240507Z ##[warning]Vstest failed with error. Check logs for failures. There might be failed tests.
2018-11-14T09:34:36.0769776Z ##[error]Error: C:Program Files (x86)Microsoft Visual Studio2017EnterpriseCommon7IDECommonExtensionsMicrosoftTestWindowvstest.console.exe failed with return code: 1
2018-11-14T09:34:36.3170630Z ##[error]VsTest task failed.
2018-11-14T09:34:36.3566464Z ##[section]Async Command Start: Publish test results
2018-11-14T09:34:36.4181634Z Publishing test results to test run '6'
2018-11-14T09:34:36.4181725Z Test results remaining: 11. Test run id: 6
2018-11-14T09:34:36.9962474Z Published Test Run : https://dev.azure.com/TrustmarqueIT/Test_2018-10-30/_TestManagement/Runs#runId=6&_a=runCharts
2018-11-14T09:34:36.9971952Z ##[section]Async Command End: Publish test results
2018-11-14T09:34:36.9972803Z ##[section]Finishing: VS Unit Test











share|improve this question














I'm getting a failed builds due to the Visual Studio Test step failing in my Build Pipeline.



I have a simple .NET Core v2.1 class library and associated MS Test library. I have 2 steps in my pipeline:



  1. A .NET Core build step, and

  2. A Visual Studio Test step

Both projects target the netcoreapp2.1 framework, see below for .csproj files.



I have tried enabling and disabling the Code coverage option, but this make no difference.



Thanks in advance,



Kaine




.csproj files



Main Project






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

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AssemblyName>Trustmarque.Core.ExtensionMethods</AssemblyName>
<RootNamespace>Trustmarque.Core.ExtensionMethods</RootNamespace>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>Generalised class extension methods build on the .NET Core.</Description>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
</ItemGroup>

</Project>





Test Project






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

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>

<IsPackable>false</IsPackable>

<AssemblyName>Trustmarque.Core.ExtensionMethods.Tests</AssemblyName>

<RootNamespace>Trustmarque.Core.ExtensionMethods.Tests</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..ExtensionMethodsExtensionMethods.csproj" />
</ItemGroup>

</Project>






YAML






queue:
name: Hosted VS2017
demands: vstest

steps:
- task: DotNetCoreCLI@2
displayName: '.NET Core Build'


- task: VSTest@2
displayName: 'VS Unit Test'
inputs:
testFiltercriteria: /diag

codeCoverageEnabled: true

otherConsoleOptions: '/framework:".NETCoreApp,Version=2.1"'






Test Output Log






2018-11-14T09:33:56.0414482Z ##[section]Starting: VS Unit Test
2018-11-14T09:33:56.0420823Z ==============================================================================
2018-11-14T09:33:56.0420887Z Task : Visual Studio Test
2018-11-14T09:33:56.0420941Z Description : Run unit and functional tests (Selenium, Appium, Coded UI test, etc.) using the Visual Studio Test (VsTest) runner. Test frameworks that have a Visual Studio test adapter such as MsTest, xUnit, NUnit, Chutzpah (for JavaScript tests using QUnit, Mocha and Jasmine), etc. can be run. Tests can be distributed on multiple agents using this task (version 2).
2018-11-14T09:33:56.0420983Z Version : 2.142.12
2018-11-14T09:33:56.0421033Z Author : Microsoft Corporation
2018-11-14T09:33:56.0421089Z Help : [More information](https://go.microsoft.com/fwlink/?LinkId=835764)
2018-11-14T09:33:56.0421126Z ==============================================================================
2018-11-14T09:33:56.9036862Z SystemVssConnection exists true
2018-11-14T09:33:57.0359241Z SystemVssConnection exists true
2018-11-14T09:33:57.1181619Z Running tests using vstest.console.exe runner.
2018-11-14T09:33:57.1181728Z ======================================================
2018-11-14T09:33:57.1182048Z Test selector : Test assemblies
2018-11-14T09:33:57.1182141Z Test filter criteria : null
2018-11-14T09:33:57.1182212Z Search folder : D:a1s
2018-11-14T09:33:57.1182743Z VisualStudio version selected for test execution : latest
2018-11-14T09:33:57.8312901Z Run in parallel : false
2018-11-14T09:33:57.8314015Z Run in isolation : false
2018-11-14T09:33:57.8315114Z Path to custom adapters : null
2018-11-14T09:33:57.8319882Z Other console options : /framework:".NETCoreApp,Version=2.1"
2018-11-14T09:33:57.8320427Z Code coverage enabled : true
2018-11-14T09:33:57.8320689Z Diagnostics enabled : false
2018-11-14T09:33:57.8322155Z SystemVssConnection exists true
2018-11-14T09:33:57.8348561Z Run the tests locally using vstest.console.exe
2018-11-14T09:33:57.8348848Z ========================================================
2018-11-14T09:33:57.8349439Z Test selector : Test assemblies
2018-11-14T09:33:57.8352816Z Test assemblies : ***test*.dll,!***TestAdapter.dll,!**obj**
2018-11-14T09:33:57.8353669Z Test filter criteria : null
2018-11-14T09:33:57.8360790Z Search folder : D:a1s
2018-11-14T09:33:57.8361971Z Run settings file : D:a1s
2018-11-14T09:33:57.8369736Z Run in parallel : false
2018-11-14T09:33:57.8370326Z Run in isolation : false
2018-11-14T09:33:57.8392182Z Path to custom adapters : null
2018-11-14T09:33:57.8393171Z Other console options : /framework:".NETCoreApp,Version=2.1"
2018-11-14T09:33:57.8395168Z Code coverage enabled : true
2018-11-14T09:33:57.8396140Z Diagnostics enabled : false
2018-11-14T09:33:57.8398717Z Rerun failed tests: false
2018-11-14T09:33:57.8401805Z VisualStudio version selected for test execution : latest
2018-11-14T09:33:58.9933609Z ========================================================
2018-11-14T09:33:58.9973631Z ======================================================
2018-11-14T09:33:59.0613609Z [command]"C:Program Files (x86)Microsoft Visual Studio2017EnterpriseCommon7IDECommonExtensionsMicrosoftTestWindowvstest.console.exe" @D:a_temp69e3bc61-e7f0-11e8-8572-4338aa006dd6.txt
2018-11-14T09:34:06.3128046Z Microsoft (R) Test Execution Command Line Tool Version 15.8.0
2018-11-14T09:34:06.3130539Z Copyright (c) Microsoft Corporation. All rights reserved.
2018-11-14T09:34:06.3131113Z
2018-11-14T09:34:06.6145727Z vstest.console.exe
2018-11-14T09:34:06.6146432Z "D:a1sExtensionMethods.TestsbinDebugnetcoreapp2.1Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll"
2018-11-14T09:34:06.6147591Z "D:a1sExtensionMethods.TestsbinDebugnetcoreapp2.1Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll"
2018-11-14T09:34:06.6147793Z "D:a1sExtensionMethods.TestsbinDebugnetcoreapp2.1Trustmarque.Core.ExtensionMethods.Tests.dll"
2018-11-14T09:34:06.6149501Z /EnableCodeCoverage
2018-11-14T09:34:06.6149657Z /logger:"trx"
2018-11-14T09:34:06.6149783Z /TestAdapterPath:"D:a1s"
2018-11-14T09:34:06.6149907Z /framework:".NETCoreApp,Version=2.1"
2018-11-14T09:34:12.8077290Z Starting test execution, please wait...
2018-11-14T09:34:14.8437128Z Test run will use DLL(s) built for framework .NETCoreApp,Version=v2.1 and platform X86. Following DLL(s) do not match framework/platform settings.
2018-11-14T09:34:14.8437793Z Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll is built for Framework 4.5 and Platform AnyCPU.
2018-11-14T09:34:14.8438215Z Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll is built for Framework 1.5 and Platform AnyCPU.
2018-11-14T09:34:14.8438617Z Go to http://go.microsoft.com/fwlink/?LinkID=236877&clcid=0x409 for more details on managing these settings.
2018-11-14T09:34:14.8438786Z
2018-11-14T09:34:23.5616980Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:23.5617265Z
2018-11-14T09:34:23.5617351Z
2018-11-14T09:34:23.5617457Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:23.5617498Z
2018-11-14T09:34:23.5617554Z
2018-11-14T09:34:23.5617591Z
2018-11-14T09:34:23.5617627Z
2018-11-14T09:34:24.4903850Z 2.8847
2018-11-14T09:34:25.4504736Z System.IO.FileNotFoundException: Unable to find tests for D:a1sExtensionMethods.TestsbinDebugnetcoreapp2.1Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk" and framework version settings are appropriate. Rerun with /diag option to diagnose further.
2018-11-14T09:34:25.4504927Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo)
2018-11-14T09:34:25.4505025Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources)
2018-11-14T09:34:25.4505077Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyExecutionManager.StartTestRun(TestRunCriteria testRunCriteria, ITestRunEventsHandler eventHandler)
2018-11-14T09:34:25.6678123Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:25.6678286Z
2018-11-14T09:34:25.6678334Z
2018-11-14T09:34:25.6678492Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:25.6678566Z
2018-11-14T09:34:25.6678623Z
2018-11-14T09:34:25.6678664Z
2018-11-14T09:34:25.6678700Z
2018-11-14T09:34:26.8351769Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:26.8351940Z
2018-11-14T09:34:26.8352006Z
2018-11-14T09:34:26.8352092Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:26.8352125Z
2018-11-14T09:34:26.8352155Z
2018-11-14T09:34:26.8352199Z
2018-11-14T09:34:26.8352227Z
2018-11-14T09:34:26.8788931Z 2.3838
2018-11-14T09:34:26.8898822Z System.IO.FileNotFoundException: Unable to find tests for D:a1sExtensionMethods.TestsbinDebugnetcoreapp2.1Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk" and framework version settings are appropriate. Rerun with /diag option to diagnose further.
2018-11-14T09:34:26.8899122Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo)
2018-11-14T09:34:26.8899942Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources)
2018-11-14T09:34:26.8900007Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyExecutionManager.StartTestRun(TestRunCriteria testRunCriteria, ITestRunEventsHandler eventHandler)
2018-11-14T09:34:26.9247283Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:26.9247370Z
2018-11-14T09:34:26.9247428Z
2018-11-14T09:34:26.9247520Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:26.9247570Z
2018-11-14T09:34:26.9247619Z
2018-11-14T09:34:26.9247650Z
2018-11-14T09:34:26.9247681Z
2018-11-14T09:34:27.4568128Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:27.4568259Z
2018-11-14T09:34:27.4568335Z
2018-11-14T09:34:27.4568442Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:27.4568504Z
2018-11-14T09:34:27.4568543Z
2018-11-14T09:34:27.4568580Z
2018-11-14T09:34:27.4568631Z
2018-11-14T09:34:27.5016363Z 3.0114
2018-11-14T09:34:33.4517174Z M i c r o s o f t ( R ) C o v e r a g e C o l l e c t i o n T o o l V e r s i o n 1 5 . 0 . 3 0 3 1 9 . 0
2018-11-14T09:34:33.4517363Z
2018-11-14T09:34:33.4517409Z
2018-11-14T09:34:33.4517517Z C o p y r i g h t ( c ) M i c r o s o f t C o r p o r a t i o n . A l l r i g h t s r e s e r v e d .
2018-11-14T09:34:33.4517603Z
2018-11-14T09:34:33.4517641Z
2018-11-14T09:34:33.4517678Z
2018-11-14T09:34:33.4517715Z
2018-11-14T09:34:33.7048135Z Passed Timestamp_DateTime_CurrentDateTime_FormatAndValuesMatch
2018-11-14T09:34:33.7048569Z Passed ToJson_Object_ReturnsStringRepresentation
2018-11-14T09:34:33.7048660Z Passed ToJsonString_Object_ReturnsStringRepresentationIncludingObjectType
2018-11-14T09:34:33.7049036Z Passed IsNullOrEmpty_String_EmptyAndNullValues
2018-11-14T09:34:33.7049135Z Passed IsNullOrEmpty_String_NonEmptyOrNullValues
2018-11-14T09:34:33.7049190Z Passed Parse_String_ValidTypeParses_CorrectTypes
2018-11-14T09:34:33.7049257Z Passed Parse_String_ValidTypeParses_DefaultTypes
2018-11-14T09:34:33.7049297Z Passed FromJson_String_ValidObjects
2018-11-14T09:34:33.7049338Z Passed FromJson_String_InvalidObjects
2018-11-14T09:34:33.7049402Z Passed IsValidEmailAddress_String_ValidEmailAddresses_ReturnTrue
2018-11-14T09:34:33.7049465Z Passed IsValidEmailAddress_String_InvalidEmailAddresses_ReturnFalse
2018-11-14T09:34:35.8172642Z Results File: D:a1sTestResultsVssAdministrator_factoryvm-az552_2018-11-14_09_34_33.trx
2018-11-14T09:34:35.8203749Z
2018-11-14T09:34:35.8210373Z Attachments:
2018-11-14T09:34:35.8210758Z D:a1sTestResults6c92c0b5-2e35-48af-867a-2a4575306a68VssAdministrator_factoryvm-az552 2018-11-14 09_34_22.coverage
2018-11-14T09:34:35.8211079Z
2018-11-14T09:34:35.8211397Z Total tests: Unknown. Passed: 11. Failed: 0. Skipped: 0.
2018-11-14T09:34:35.8211670Z Test Run Aborted.
2018-11-14T09:34:35.8211939Z Test execution time: 10.7395 Seconds
2018-11-14T09:34:36.0240507Z ##[warning]Vstest failed with error. Check logs for failures. There might be failed tests.
2018-11-14T09:34:36.0769776Z ##[error]Error: C:Program Files (x86)Microsoft Visual Studio2017EnterpriseCommon7IDECommonExtensionsMicrosoftTestWindowvstest.console.exe failed with return code: 1
2018-11-14T09:34:36.3170630Z ##[error]VsTest task failed.
2018-11-14T09:34:36.3566464Z ##[section]Async Command Start: Publish test results
2018-11-14T09:34:36.4181634Z Publishing test results to test run '6'
2018-11-14T09:34:36.4181725Z Test results remaining: 11. Test run id: 6
2018-11-14T09:34:36.9962474Z Published Test Run : https://dev.azure.com/TrustmarqueIT/Test_2018-10-30/_TestManagement/Runs#runId=6&_a=runCharts
2018-11-14T09:34:36.9971952Z ##[section]Async Command End: Publish test results
2018-11-14T09:34:36.9972803Z ##[section]Finishing: VS Unit Test







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

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AssemblyName>Trustmarque.Core.ExtensionMethods</AssemblyName>
<RootNamespace>Trustmarque.Core.ExtensionMethods</RootNamespace>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>Generalised class extension methods build on the .NET Core.</Description>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
</ItemGroup>

</Project>





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

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AssemblyName>Trustmarque.Core.ExtensionMethods</AssemblyName>
<RootNamespace>Trustmarque.Core.ExtensionMethods</RootNamespace>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>Generalised class extension methods build on the .NET Core.</Description>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
</ItemGroup>

</Project>





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

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>

<IsPackable>false</IsPackable>

<AssemblyName>Trustmarque.Core.ExtensionMethods.Tests</AssemblyName>

<RootNamespace>Trustmarque.Core.ExtensionMethods.Tests</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..ExtensionMethodsExtensionMethods.csproj" />
</ItemGroup>

</Project>





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

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>

<IsPackable>false</IsPackable>

<AssemblyName>Trustmarque.Core.ExtensionMethods.Tests</AssemblyName>

<RootNamespace>Trustmarque.Core.ExtensionMethods.Tests</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..ExtensionMethodsExtensionMethods.csproj" />
</ItemGroup>

</Project>






azure-devops azure-pipelines azure-pipelines-build-task






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 14 '18 at 16:24









KaineKaine

665




665












  • Did you try to add dotnet restore task before your dotnet build in order to make sure the dependencies were installed correctly?

    – Jayendran
    Nov 15 '18 at 2:34












  • Hi @Jayendran, thanks for your suggestion. I didn't have a dotnet restore step, added it, but it still fails. Here's the YAML: resources: - repo: self queue: name: Hosted VS2017 demands: vstest steps: - task: DotNetCoreCLI@2 displayName: '.NET Core Restore' inputs: command: restore - task: DotNetCoreCLI@2 displayName: '.NET Core Build' - task: VSTest@2 displayName: 'VS Unit Test' inputs: testFiltercriteria: /diag codeCoverageEnabled: true otherConsoleOptions: '/framework:".NETCoreApp,Version=2.1"'

    – Kaine
    Nov 15 '18 at 10:43












  • Have you tried the default .NET Core build-pipeline template? Does that work without changing anything?

    – Jonathan Twite
    Nov 15 '18 at 10:55











  • Hi @JonathanTwite, I think that you are talking about the DotNetCoreCLI@2 step in the original YAML. This is the standard .NET Core build-pipeline template as far as I know. This by itself works without issue. The problem comes when I add the test step. Also, using the standard Azure Repos build template runs perfectly, but won't run the test steps as it builds on Ubuntu and the only way to add the Test step or change the vmImage is to edit the YAML, an area of expertise that I seriously lack... ;-)

    – Kaine
    Nov 15 '18 at 11:35











  • I was suggesting you try the build template (full build, not single task) provided in the DevOps front-end, rather than writing the YAML yourself - then if that works, you can compare.

    – Jonathan Twite
    Nov 15 '18 at 11:41

















  • Did you try to add dotnet restore task before your dotnet build in order to make sure the dependencies were installed correctly?

    – Jayendran
    Nov 15 '18 at 2:34












  • Hi @Jayendran, thanks for your suggestion. I didn't have a dotnet restore step, added it, but it still fails. Here's the YAML: resources: - repo: self queue: name: Hosted VS2017 demands: vstest steps: - task: DotNetCoreCLI@2 displayName: '.NET Core Restore' inputs: command: restore - task: DotNetCoreCLI@2 displayName: '.NET Core Build' - task: VSTest@2 displayName: 'VS Unit Test' inputs: testFiltercriteria: /diag codeCoverageEnabled: true otherConsoleOptions: '/framework:".NETCoreApp,Version=2.1"'

    – Kaine
    Nov 15 '18 at 10:43












  • Have you tried the default .NET Core build-pipeline template? Does that work without changing anything?

    – Jonathan Twite
    Nov 15 '18 at 10:55











  • Hi @JonathanTwite, I think that you are talking about the DotNetCoreCLI@2 step in the original YAML. This is the standard .NET Core build-pipeline template as far as I know. This by itself works without issue. The problem comes when I add the test step. Also, using the standard Azure Repos build template runs perfectly, but won't run the test steps as it builds on Ubuntu and the only way to add the Test step or change the vmImage is to edit the YAML, an area of expertise that I seriously lack... ;-)

    – Kaine
    Nov 15 '18 at 11:35











  • I was suggesting you try the build template (full build, not single task) provided in the DevOps front-end, rather than writing the YAML yourself - then if that works, you can compare.

    – Jonathan Twite
    Nov 15 '18 at 11:41
















Did you try to add dotnet restore task before your dotnet build in order to make sure the dependencies were installed correctly?

– Jayendran
Nov 15 '18 at 2:34






Did you try to add dotnet restore task before your dotnet build in order to make sure the dependencies were installed correctly?

– Jayendran
Nov 15 '18 at 2:34














Hi @Jayendran, thanks for your suggestion. I didn't have a dotnet restore step, added it, but it still fails. Here's the YAML: resources: - repo: self queue: name: Hosted VS2017 demands: vstest steps: - task: DotNetCoreCLI@2 displayName: '.NET Core Restore' inputs: command: restore - task: DotNetCoreCLI@2 displayName: '.NET Core Build' - task: VSTest@2 displayName: 'VS Unit Test' inputs: testFiltercriteria: /diag codeCoverageEnabled: true otherConsoleOptions: '/framework:".NETCoreApp,Version=2.1"'

– Kaine
Nov 15 '18 at 10:43






Hi @Jayendran, thanks for your suggestion. I didn't have a dotnet restore step, added it, but it still fails. Here's the YAML: resources: - repo: self queue: name: Hosted VS2017 demands: vstest steps: - task: DotNetCoreCLI@2 displayName: '.NET Core Restore' inputs: command: restore - task: DotNetCoreCLI@2 displayName: '.NET Core Build' - task: VSTest@2 displayName: 'VS Unit Test' inputs: testFiltercriteria: /diag codeCoverageEnabled: true otherConsoleOptions: '/framework:".NETCoreApp,Version=2.1"'

– Kaine
Nov 15 '18 at 10:43














Have you tried the default .NET Core build-pipeline template? Does that work without changing anything?

– Jonathan Twite
Nov 15 '18 at 10:55





Have you tried the default .NET Core build-pipeline template? Does that work without changing anything?

– Jonathan Twite
Nov 15 '18 at 10:55













Hi @JonathanTwite, I think that you are talking about the DotNetCoreCLI@2 step in the original YAML. This is the standard .NET Core build-pipeline template as far as I know. This by itself works without issue. The problem comes when I add the test step. Also, using the standard Azure Repos build template runs perfectly, but won't run the test steps as it builds on Ubuntu and the only way to add the Test step or change the vmImage is to edit the YAML, an area of expertise that I seriously lack... ;-)

– Kaine
Nov 15 '18 at 11:35





Hi @JonathanTwite, I think that you are talking about the DotNetCoreCLI@2 step in the original YAML. This is the standard .NET Core build-pipeline template as far as I know. This by itself works without issue. The problem comes when I add the test step. Also, using the standard Azure Repos build template runs perfectly, but won't run the test steps as it builds on Ubuntu and the only way to add the Test step or change the vmImage is to edit the YAML, an area of expertise that I seriously lack... ;-)

– Kaine
Nov 15 '18 at 11:35













I was suggesting you try the build template (full build, not single task) provided in the DevOps front-end, rather than writing the YAML yourself - then if that works, you can compare.

– Jonathan Twite
Nov 15 '18 at 11:41





I was suggesting you try the build template (full build, not single task) provided in the DevOps front-end, rather than writing the YAML yourself - then if that works, you can compare.

– Jonathan Twite
Nov 15 '18 at 11:41












2 Answers
2






active

oldest

votes


















0














Thanks @Gurpreet for prompting me to document my solution.



It's been quite a while, so my memory of the steps is a bit shaky, but I believe that my mistake was thinking that, on the first screen after selecting a source repository, I assumed the templates listed were all that was available and that Empty job was the same as the YAML template. I'd incorrectly assumed that Empty job meant that I'd have to edit the YAML myself.



Jonathan Twite gave me some great pointers but I didn't quite grasp what he was suggesting at the time.



The Solution



Anyway, the solution was to select either Empty job or scroll to the bottom and select Empty pipeline, why they're referred to by different names is a mystery.



Choose Empty job or Empty pipeline



After selecting the empty template, the next screen provides you with a default Agent job. Clicking the plus, you can add a variety of different tasks. This was part of my original mistake, I confused the tasks with the templates on the previous screen.



I added the .NET Core task.



Add the .NET Core task to the Agent job



I changed the Display name and the Command, as well as making sure that the Version was correct. Interestingly, the Command has a number of interesting options, three of which that I found useful are:



  • restore

  • build

  • test

So, rather than adding a specific Test task, you add the .NET Core task and configure it to do the test bit. This was a bit confusing for me, I didn't realise that the .NET Core task was capable of doing the testing as well.



Configure the .NET Core task to either a restore, build or test step



In my case, I also started testing the ability to deploy NuGet packages, but that's a whole other can of worms.



I hope that this has helped, and wish you all good luck with your projects.



Kaine






share|improve this answer






























    0














    I have solved my problem by revising my filter to find test assemblies. when i was messing around with my test step then i had set the filter to "/**/UnitTests.dll" and i did not realise that it was also matching UnitTests.dll in the "obj" folder and that folder does not have .deps.json files. from the logs i noticed that it was running tests twice (once for each matching dll) so then i ignored the obj folder by reverting back my filter to exclude obj folder. So i guess two things to take care in such cases, 1. you must have "Microsoft.NET.Test.Sdk" installed on your test project and 2. your filter does not include or exclude any unwanted dlls which you (dont want / want to) be there






    share|improve this answer























    • Nice one @Gurpreet. You can see that, in the example I posted, I filter on test projects in the Path to project(s) field. Not sure if this is of any assistance in your case.

      – Kaine
      Feb 1 at 13:13










    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53304671%2fvs-test-failing-in-pipelines-with-missing-microsoft-net-test-sdk%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Thanks @Gurpreet for prompting me to document my solution.



    It's been quite a while, so my memory of the steps is a bit shaky, but I believe that my mistake was thinking that, on the first screen after selecting a source repository, I assumed the templates listed were all that was available and that Empty job was the same as the YAML template. I'd incorrectly assumed that Empty job meant that I'd have to edit the YAML myself.



    Jonathan Twite gave me some great pointers but I didn't quite grasp what he was suggesting at the time.



    The Solution



    Anyway, the solution was to select either Empty job or scroll to the bottom and select Empty pipeline, why they're referred to by different names is a mystery.



    Choose Empty job or Empty pipeline



    After selecting the empty template, the next screen provides you with a default Agent job. Clicking the plus, you can add a variety of different tasks. This was part of my original mistake, I confused the tasks with the templates on the previous screen.



    I added the .NET Core task.



    Add the .NET Core task to the Agent job



    I changed the Display name and the Command, as well as making sure that the Version was correct. Interestingly, the Command has a number of interesting options, three of which that I found useful are:



    • restore

    • build

    • test

    So, rather than adding a specific Test task, you add the .NET Core task and configure it to do the test bit. This was a bit confusing for me, I didn't realise that the .NET Core task was capable of doing the testing as well.



    Configure the .NET Core task to either a restore, build or test step



    In my case, I also started testing the ability to deploy NuGet packages, but that's a whole other can of worms.



    I hope that this has helped, and wish you all good luck with your projects.



    Kaine






    share|improve this answer



























      0














      Thanks @Gurpreet for prompting me to document my solution.



      It's been quite a while, so my memory of the steps is a bit shaky, but I believe that my mistake was thinking that, on the first screen after selecting a source repository, I assumed the templates listed were all that was available and that Empty job was the same as the YAML template. I'd incorrectly assumed that Empty job meant that I'd have to edit the YAML myself.



      Jonathan Twite gave me some great pointers but I didn't quite grasp what he was suggesting at the time.



      The Solution



      Anyway, the solution was to select either Empty job or scroll to the bottom and select Empty pipeline, why they're referred to by different names is a mystery.



      Choose Empty job or Empty pipeline



      After selecting the empty template, the next screen provides you with a default Agent job. Clicking the plus, you can add a variety of different tasks. This was part of my original mistake, I confused the tasks with the templates on the previous screen.



      I added the .NET Core task.



      Add the .NET Core task to the Agent job



      I changed the Display name and the Command, as well as making sure that the Version was correct. Interestingly, the Command has a number of interesting options, three of which that I found useful are:



      • restore

      • build

      • test

      So, rather than adding a specific Test task, you add the .NET Core task and configure it to do the test bit. This was a bit confusing for me, I didn't realise that the .NET Core task was capable of doing the testing as well.



      Configure the .NET Core task to either a restore, build or test step



      In my case, I also started testing the ability to deploy NuGet packages, but that's a whole other can of worms.



      I hope that this has helped, and wish you all good luck with your projects.



      Kaine






      share|improve this answer

























        0












        0








        0







        Thanks @Gurpreet for prompting me to document my solution.



        It's been quite a while, so my memory of the steps is a bit shaky, but I believe that my mistake was thinking that, on the first screen after selecting a source repository, I assumed the templates listed were all that was available and that Empty job was the same as the YAML template. I'd incorrectly assumed that Empty job meant that I'd have to edit the YAML myself.



        Jonathan Twite gave me some great pointers but I didn't quite grasp what he was suggesting at the time.



        The Solution



        Anyway, the solution was to select either Empty job or scroll to the bottom and select Empty pipeline, why they're referred to by different names is a mystery.



        Choose Empty job or Empty pipeline



        After selecting the empty template, the next screen provides you with a default Agent job. Clicking the plus, you can add a variety of different tasks. This was part of my original mistake, I confused the tasks with the templates on the previous screen.



        I added the .NET Core task.



        Add the .NET Core task to the Agent job



        I changed the Display name and the Command, as well as making sure that the Version was correct. Interestingly, the Command has a number of interesting options, three of which that I found useful are:



        • restore

        • build

        • test

        So, rather than adding a specific Test task, you add the .NET Core task and configure it to do the test bit. This was a bit confusing for me, I didn't realise that the .NET Core task was capable of doing the testing as well.



        Configure the .NET Core task to either a restore, build or test step



        In my case, I also started testing the ability to deploy NuGet packages, but that's a whole other can of worms.



        I hope that this has helped, and wish you all good luck with your projects.



        Kaine






        share|improve this answer













        Thanks @Gurpreet for prompting me to document my solution.



        It's been quite a while, so my memory of the steps is a bit shaky, but I believe that my mistake was thinking that, on the first screen after selecting a source repository, I assumed the templates listed were all that was available and that Empty job was the same as the YAML template. I'd incorrectly assumed that Empty job meant that I'd have to edit the YAML myself.



        Jonathan Twite gave me some great pointers but I didn't quite grasp what he was suggesting at the time.



        The Solution



        Anyway, the solution was to select either Empty job or scroll to the bottom and select Empty pipeline, why they're referred to by different names is a mystery.



        Choose Empty job or Empty pipeline



        After selecting the empty template, the next screen provides you with a default Agent job. Clicking the plus, you can add a variety of different tasks. This was part of my original mistake, I confused the tasks with the templates on the previous screen.



        I added the .NET Core task.



        Add the .NET Core task to the Agent job



        I changed the Display name and the Command, as well as making sure that the Version was correct. Interestingly, the Command has a number of interesting options, three of which that I found useful are:



        • restore

        • build

        • test

        So, rather than adding a specific Test task, you add the .NET Core task and configure it to do the test bit. This was a bit confusing for me, I didn't realise that the .NET Core task was capable of doing the testing as well.



        Configure the .NET Core task to either a restore, build or test step



        In my case, I also started testing the ability to deploy NuGet packages, but that's a whole other can of worms.



        I hope that this has helped, and wish you all good luck with your projects.



        Kaine







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 1 at 10:16









        KaineKaine

        665




        665























            0














            I have solved my problem by revising my filter to find test assemblies. when i was messing around with my test step then i had set the filter to "/**/UnitTests.dll" and i did not realise that it was also matching UnitTests.dll in the "obj" folder and that folder does not have .deps.json files. from the logs i noticed that it was running tests twice (once for each matching dll) so then i ignored the obj folder by reverting back my filter to exclude obj folder. So i guess two things to take care in such cases, 1. you must have "Microsoft.NET.Test.Sdk" installed on your test project and 2. your filter does not include or exclude any unwanted dlls which you (dont want / want to) be there






            share|improve this answer























            • Nice one @Gurpreet. You can see that, in the example I posted, I filter on test projects in the Path to project(s) field. Not sure if this is of any assistance in your case.

              – Kaine
              Feb 1 at 13:13















            0














            I have solved my problem by revising my filter to find test assemblies. when i was messing around with my test step then i had set the filter to "/**/UnitTests.dll" and i did not realise that it was also matching UnitTests.dll in the "obj" folder and that folder does not have .deps.json files. from the logs i noticed that it was running tests twice (once for each matching dll) so then i ignored the obj folder by reverting back my filter to exclude obj folder. So i guess two things to take care in such cases, 1. you must have "Microsoft.NET.Test.Sdk" installed on your test project and 2. your filter does not include or exclude any unwanted dlls which you (dont want / want to) be there






            share|improve this answer























            • Nice one @Gurpreet. You can see that, in the example I posted, I filter on test projects in the Path to project(s) field. Not sure if this is of any assistance in your case.

              – Kaine
              Feb 1 at 13:13













            0












            0








            0







            I have solved my problem by revising my filter to find test assemblies. when i was messing around with my test step then i had set the filter to "/**/UnitTests.dll" and i did not realise that it was also matching UnitTests.dll in the "obj" folder and that folder does not have .deps.json files. from the logs i noticed that it was running tests twice (once for each matching dll) so then i ignored the obj folder by reverting back my filter to exclude obj folder. So i guess two things to take care in such cases, 1. you must have "Microsoft.NET.Test.Sdk" installed on your test project and 2. your filter does not include or exclude any unwanted dlls which you (dont want / want to) be there






            share|improve this answer













            I have solved my problem by revising my filter to find test assemblies. when i was messing around with my test step then i had set the filter to "/**/UnitTests.dll" and i did not realise that it was also matching UnitTests.dll in the "obj" folder and that folder does not have .deps.json files. from the logs i noticed that it was running tests twice (once for each matching dll) so then i ignored the obj folder by reverting back my filter to exclude obj folder. So i guess two things to take care in such cases, 1. you must have "Microsoft.NET.Test.Sdk" installed on your test project and 2. your filter does not include or exclude any unwanted dlls which you (dont want / want to) be there







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Feb 1 at 10:46









            GurpreetGurpreet

            642316




            642316












            • Nice one @Gurpreet. You can see that, in the example I posted, I filter on test projects in the Path to project(s) field. Not sure if this is of any assistance in your case.

              – Kaine
              Feb 1 at 13:13

















            • Nice one @Gurpreet. You can see that, in the example I posted, I filter on test projects in the Path to project(s) field. Not sure if this is of any assistance in your case.

              – Kaine
              Feb 1 at 13:13
















            Nice one @Gurpreet. You can see that, in the example I posted, I filter on test projects in the Path to project(s) field. Not sure if this is of any assistance in your case.

            – Kaine
            Feb 1 at 13:13





            Nice one @Gurpreet. You can see that, in the example I posted, I filter on test projects in the Path to project(s) field. Not sure if this is of any assistance in your case.

            – Kaine
            Feb 1 at 13:13

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53304671%2fvs-test-failing-in-pipelines-with-missing-microsoft-net-test-sdk%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            27

            Top Tejano songwriter Luis Silva dead of heart attack at 64

            Category:Rhetoric