VSTS: Test runner finds no tests - visual-studio-2017

I have a .net 4.6 MVC app and a standard test project which was generated by Visual Studio with a few controller tests. These all discover and pass in VS test runner but I'm trying to get VSTS to execute these tests now and fail the build if any tests fail. However, no tests are discovered and I get a lot of 'Input string not in the correct format' error.
I haven't changed anything in the tests and all I did was add the test task to my build phase.
Here is the full test output:
2017-11-28T09:54:11.2442325Z ##[section]Starting: Run Unit Tests
2017-11-28T09:54:11.2598856Z ==============================================================================
2017-11-28T09:54:11.2598856Z Task : Visual Studio Test
2017-11-28T09:54:11.2598856Z Description : Run tests with Visual Studio test runner
2017-11-28T09:54:11.2598856Z Version : 2.2.3
2017-11-28T09:54:11.2598856Z Author : Microsoft Corporation
2017-11-28T09:54:11.2598856Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkId=835764)
2017-11-28T09:54:11.2598856Z ==============================================================================
2017-11-28T09:54:14.6192312Z Run the tests locally using vstest.console.exe
2017-11-28T09:54:14.6192312Z ========================================================
2017-11-28T09:54:14.6192312Z Test selector : Test assemblies
2017-11-28T09:54:14.6192312Z Test assemblies : **\*test*.dll,!**\obj\**
2017-11-28T09:54:14.6192312Z Test filter criteria : null
2017-11-28T09:54:14.6192312Z Search folder : C:\agent\_work\1\s
2017-11-28T09:54:14.6192312Z Run settings file : C:\agent\_work\1\s
2017-11-28T09:54:14.6192312Z Run in parallel : false
2017-11-28T09:54:14.6192312Z Run in isolation : false
2017-11-28T09:54:14.6192312Z Path to custom adapters : null
2017-11-28T09:54:14.6192312Z Other console options : null
2017-11-28T09:54:14.6192312Z Code coverage enabled : false
2017-11-28T09:54:14.6192312Z VisualStudio version selected for test execution : latest
2017-11-28T09:54:16.7609946Z ========================================================
2017-11-28T09:54:19.1015214Z [command]"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" #C:\agent\_work\_temp\18c48b81-d422-11e7-8218-574cad38a3a3.txt
2017-11-28T09:54:26.1576050Z Microsoft (R) Test Execution Command Line Tool Version 15.0.26228.0
2017-11-28T09:54:26.1576050Z Copyright (c) Microsoft Corporation. All rights reserved.
2017-11-28T09:54:26.1576050Z
2017-11-28T09:54:26.1576050Z vstest.console.exe
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\Microsoft.VisualStudio.TestPlatform.TestFramework.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\cs\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\cs\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\cs\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\de\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\de\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\de\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\es\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\es\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\es\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\fr\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\fr\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\fr\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\it\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\it\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\it\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\ja\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\ja\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\ja\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\ko\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\ko\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\ko\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\pl\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\pl\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\pl\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\pt\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\pt\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\pt\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\ru\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\ru\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\ru\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\tr\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\tr\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\tr\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\uap10.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestFramework.1.1.17\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestFramework.1.1.17\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestFramework.1.1.17\lib\netstandard1.0\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestFramework.1.1.17\lib\netstandard1.0\Microsoft.VisualStudio.TestPlatform.TestFramework.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestFramework.1.1.17\lib\uap10.0\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll"
2017-11-28T09:54:26.1576050Z "C:\agent\_work\1\s\MVC5\packages\MSTest.TestFramework.1.1.17\lib\uap10.0\Microsoft.VisualStudio.TestPlatform.TestFramework.dll"
2017-11-28T09:54:26.1576050Z /logger:"trx"
2017-11-28T09:54:26.1576050Z /TestAdapterPath:"C:\agent\_work\1\s"
2017-11-28T09:54:29.0388328Z Starting test execution, please wait...
2017-11-28T09:54:35.4463920Z Warning: Input string was not in a correct format.
2017-11-28T09:54:35.4463920Z
2017-11-28T09:54:35.8082157Z Warning: Unable to load types from the test source 'C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\uap10.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll'. Some or all of the tests in this source may not be discovered.
2017-11-28T09:54:35.8082157Z
2017-11-28T09:54:35.8394672Z Warning: Input string was not in a correct format.
2017-11-28T09:54:35.8394672Z
2017-11-28T09:54:36.1206800Z Warning: Input string was not in a correct format.
2017-11-28T09:54:36.1206800Z
2017-11-28T09:54:36.1676432Z Warning: Input string was not in a correct format.
2017-11-28T09:54:36.1676432Z
2017-11-28T09:54:36.3706773Z Warning: Unable to load types from the test source 'C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll'. Some or all of the tests in this source may not be discovered.
2017-11-28T09:54:36.3706773Z
2017-11-28T09:54:37.0547894Z Warning: No test is available in C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\pt\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\ru\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\ru\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\ru\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\tr\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\tr\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\tr\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\pt\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\uap10.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestFramework.1.1.17\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestFramework.1.1.17\lib\netstandard1.0\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestFramework.1.1.17\lib\netstandard1.0\Microsoft.VisualStudio.TestPlatform.TestFramework.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestFramework.1.1.17\lib\uap10.0\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestFramework.1.1.17\lib\uap10.0\Microsoft.VisualStudio.TestPlatform.TestFramework.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\pt\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\pl\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\Microsoft.VisualStudio.TestPlatform.TestFramework.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\cs\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\cs\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\cs\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\de\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\de\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\de\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\es\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\es\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\pl\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\es\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\fr\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\fr\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\it\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\it\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\it\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\ja\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\ja\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\ja\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\ko\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\ko\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\ko\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\pl\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\fr\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestFramework.1.1.17\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll C:\agent\_work\1\s\MVC5\packages\MSTest.TestAdapter.1.1.17\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.
2017-11-28T09:54:37.0547894Z
2017-11-28T09:54:37.0700167Z
2017-11-28T09:54:37.6168898Z Information: Additionally, you can try specifying '/UseVsixExtensions' command if the test discoverer & executor is installed on the machine as vsix extensions and your installation supports vsix extensions. Example: vstest.console.exe myTests.dll /UseVsixExtensions:true
2017-11-28T09:54:37.6168898Z
2017-11-28T09:54:38.6066846Z ##[warning]No results found to publish.
2017-11-28T09:54:38.6066846Z ##[section]Finishing: Run Unit Tests
Has anyone come across this before? I kinda assumed that the standard Visual Studio test task in VSTS would run a standard test project generated by VS2017 by default!
Thanks
My SLN is a simple file->new app and has two projects:

The template provided in VSTS for the Visual Studio Test defaults the Test Assemblies parameter as:
**\*test*.dll
!**\*TestAdapter.dll
!**\obj\**
Unfortunately, other assemblies may sneak into the search path. Try adjusting the Test Assemblies to the following:
**\*test*.dll
!**\*TestAdapter*.dll <--- changed
!**\*VisualStudio*.dll <--- added
!**\obj\**

Change Test assemblies in Visual Studio Test task to match the test project name.
For example, the name of your test project is UnitTestProject1, then change **\*test*.dll to **\*UnitTest*.dll in Test assemblies box.

Related

Issues when unit testing .net Core app in Azure Dev Ops

I have a .net core 2.2 project, with some unit tests that test a class library project using Visual Studio Testing
Visual Studio Test - YAML
steps:
- task: VSTest#2
displayName: 'VsTest - testAssemblies'
inputs:
testAssemblyVer2: |
**\*test*.dll
!**\*TestAdapter.dll
!**\obj\**
**\$(BuildConfiguration)\*\*unittests.dll
**\$(BuildConfiguration)\*\*test*.dll
!**\*Microsoft.VisualStudio.TestPlatform*
vstestLocationMethod: location
vstestLocation: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\TestPlatform\'
codeCoverageEnabled: true
otherConsoleOptions: '/Framework:.NETCoreApp,Version=v2.2 /logger:console;verbosity="normal"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
timeoutInMinutes: 1
And the error message
[warning]No test assemblies found matching the pattern:
*test*.dll,!*TestAdapter.dll,!\obj**,\Release**unittests.dll,\Release**test*.dll,!*Microsoft.VisualStudio.TestPlatform*.
Can anyone identify what needs to be done to make it work?
I have tried various different options for the above
I believe you need to be pointing to the projects themselves; not the output DLL's.
So your pattern needs to look more like this: **/*[Tt]ests/*.csproj
Which will cause DEV Ops to load all projects that have Tests in its Project Name

Could not load file or assembly System.Reflection.TypeExtensions

I got below exception while running xunit test projects which works under VS 2017 15.3
[2017/12/4 23:08:40 Error] [xUnit.net 00:00:00.0033291] xxx.Test: Catastrophic failure: System.TypeInitializationException: The type initializer for 'Xunit.DiaSession' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Reflection.TypeExtensions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
at Xunit.DiaSession..cctor()
--- End of inner exception stack trace ---
at Xunit.DiaSession..ctor(String assemblyFileName)
at Xunit.DiaSessionWrapper..ctor(String assemblyFilename)
at Xunit.XunitFrontController..ctor(AppDomainSupport appDomainSupport, String assemblyFileName, String configFileName, Boolean shadowCopy, String shadowCopyFolder, ISourceInformationProvider sourceInformationProvider, IMessageSink diagnosticMessageSink)
at Xunit.Runner.VisualStudio.TestAdapter.VsTestRunner.RunTestsInAssembly(IRunContext runContext, IFrameworkHandle frameworkHandle, LoggerHelper logger, IMessageSinkWithTypes reporterMessageHandler, AssemblyRunInfo runInfo)
My current VS 2017 version is 15.4.5.
I have tried the work around which has been provided previously, but none did not work. And I have try to downgrade my VS 2016 to 15.3, but I could not find the 15.3 package to install. I have tried to install xunit to latest version.
Any help would be appreciated.
Update:
Project Type:xUnit Test Project(.NET Core)
Target: net 461
It seems VS 2017 fail to load specific "xunit.runner.visualstudio", after checking VS2017 15.4.2 - Unable to run tests for projects targeting .NET Framework 4.6.x #1542 again, I deleted the "%TEMP%\VisualStudioTestExplorerExtensions", create a new Xunit project, change the nonworked.csproj xunit.runner.visualstudio from 2.2.0 to 2.3.1, it works now. Not sure why it did not work when I try it previous.
Hope it will help others.
You need to install System.Reflection.TypeExtensions using VS Package Manager using the following command:
Install-Package System.Reflection.TypeExtensions -Version 4.5.1
for more information please review the following link
System.Reflection.TypeExtensions

Appveyor runs tests but OpenCover doesn't show coverage

I am building the project and running test cases in appveyor. After successfully executing test cases the coverage data must be uploaded to coveralls.
But in my case no error is thrown but coverage is being recorded.
The details of my project are
.Net Core 1.1.0
Visual Studio 2017
xunit - 2.2.0
OpenCover - 4.6.519
coveralls.net - 0.7.0
My appveyor.yml is as below :
version: 1.0.{build}
os: Visual Studio 2017
skip_tags: true
configuration: Release
environment:
nodejs_version: "0.12"
COVERALLS_REPO_TOKEN:
secure: rstgrtert
cache:
- "%LOCALAPPDATA%\\Yarn"
install:
- npm i -g yarn#0.16.1
- npm i -g typescript typings
- yarn global add typescript typings
- cd ".\Promact.Oauth.Server\src\Promact.Oauth.Server\"
- yarn
- cd..
- cd..
build_script:
- ps: dotnet restore
build:
project: .\Promact.Oauth.Server\Promact.Oauth.Server.sln
verbosity: minimal
test_script:
- cd ".\src\"
- ps: >-
C:\Users\appveyor\.nuget\packages\OpenCover\4.6.519\tools\OpenCover.Console.exe-target:"C:\Program Files\dotnet\dotnet.exe" -targetargs:"test -f netcoreapp1.1 -c Release .\Promact.Oauth.Server.Tests\Promact.Oauth.Server.Tests.csproj" -mergeoutput -hideskipped:File -output:opencover.xml -oldStyle -filter:"+[Promact.Oauth.Server]*Repository -[Promact.Oauth.Server.Tests*]*" -register:user
if(![string]::IsNullOrEmpty($env:COVERALLS_REPO_TOKEN)){
$coveralls = (Resolve-Path "C:\Users\appveyor\.nuget\packages\coveralls.net\0.7.0\tools\csmacnz.coveralls. exe").ToString()
& $coveralls --opencover -i opencover.xml --repoToken
$env:COVERALLS_REPO_TOKEN --commitId $env:APPVEYOR_REPO_COMMIT --commitBranch $env:APPVEYOR_REPO_BRANCH --commitAuthor $env:APPVEYOR_REPO_COMMIT_AUTHOR --commitEmail $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL --commitMessage $env:APPVEYOR_REPO_COMMIT_MESSAGE --jobId $env:APPVEYOR_JOB_ID
}
In appveyor it runs the test and simply shows
Committing...
No results, this could be for a number of reasons. The most common reasons are:
1) missing PDBs for the assemblies that match the filter please review the
output file and refer to the Usage guide (Usage.rtf) about filters.
2) the profiler may not be registered correctly, please refer to the Usage
guide and the -register switch.
Coverage data uploaded to coveralls.
link to the appveyor build

Unable to install exenstions and updates for Visual Studio 2017 RC (15.0.26014.0)

I recently installed Visual Studio 2017 RC (15.0.26014.0) and was trying to install extensions. However while installing any extension using Tools->Extensions and Updates menu fails. Following is installation log.
27-Dec-16 10:35:19 AM - Beginning to install extension to Microsoft Visual Studio Enterprise 2017 RC...
27-Dec-16 10:35:19 AM - Install Error : System.IO.FileNotFoundException: Unable to find the specified file.
at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.GetCurrentSetupInstance()
at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.PerformSetupEngineInstall(InstallableExtensionImpl extension, Boolean installPerMachine, Boolean isPackComponent, IDictionary`2 extensionsInstalledSoFar, List`1 extensionsUninstalledSoFar, IInstalledExtensionList modifiedInstalledExtensionsList, IProgress`1 progress, InstallFlags installFlags, AsyncOperation asyncOp, IInstalledExtension& newExtension)
Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.InstallInternal (InstallableExtensionImpl extension, InstallFlags installFlags, IDictionary`2 extensionsInstalledSoFar, List`1 extensionsUninstalledSoFar,
IInstalledExtensionList modifiedInstalledExtensionsList, AsyncOperation asyncOp, IProgress`1 progress)
at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.BeginInstall(IInstallableExtension installableExtension, InstallFlags installFlags, AsyncOperation asyncOp)
at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.InstallWorker(IInstallableExtension extension, InstallFlags installFlags, AsyncOperation asyncOp)
I checked and found corresponding VSIX file is present in temp folder (C:\Users\xxxxx\AppData\Local\Temp)
I'm currently having the same problems. According to this post, repairing the installation might help.

Execute package failed in Sitecore Azure deployment

I have started the deployment of Editing farm and after some time got this error. Before that Databases are created in Azure.
Execute package failed System.ApplicationException: advaiyawebsiteDevScusCe01Role01SSc5e3Staging [S]
Execute package failed ---> System.ApplicationException: Execute package is failed ---> System.InvalidOperationException:
Build Package failed: Searching for imported module Caching at
C:\Program Files\Microsoft SDKs\Azure\.NET SDK\v2.5\bin\plugins\Caching\Caching.csplugin...
Copying 'C:\InetPub\Sitecoredemo\Data\AzurePackages\(7) Azure\Sitecore.Azure.CacheWorkerRole'
to C:\Windows\TEMP\odbndccq.v4c\roles\SitecoreCacheWorkerRole\approot... Copying
'C:\Program Files\Microsoft SDKs\Azure\.NET SDK\v2.5\bin\runtimes\base\x64'
to C:\Windows\TEMP\odbndccq.v4c\roles\SitecoreCacheWorkerRole\base\x64... Copying
'C:\Program Files\Microsoft SDKs\Azure\.NET SDK\v2.5\bin\runtimes\base\x86'
to C:\Windows\TEMP\odbndccq.v4c\roles\SitecoreCacheWorkerRole\base\x86... Copying
'C:\InetPub\Sitecoredemo\Data\AzurePackages\(7) Azure\SitecoreWebSite' to
C:\Windows\TEMP\odbndccq.v4c\roles\SitecoreWebRole\approot... Copying
'C:\Program Files\Microsoft SDKs\Azure\.NET SDK\v2.5\bin\runtimes\base\x64'
to C:\Windows\TEMP\odbndccq.v4c\roles\SitecoreWebRole\base\x64... Copying
'C:\Program Files\Microsoft SDKs\Azure\.NET SDK\v2.5\bin\runtimes\base\x86'
to C:\Windows\TEMP\odbndccq.v4c\roles\SitecoreWebRole\base\x86... Copying
'C:\Program Files\Microsoft SDKs\Azure\.NET SDK\v2.5\bin\plugins\Caching'
to C:\Windows\TEMP\odbndccq.v4c\roles\SitecoreCacheWorkerRole\plugins\Caching...
UCPack_Command_Line: Error : CloudServices41 : The entrypoint Sitecore.Azure.CacheWorkerRole.dll is not a valid assembly.
Please provide a relative path to the binary that implements the entrypoint.
at Sitecore.Diagnostics.Assert.IsFalse(Boolean condition, String message)
at Sitecore.Azure.Pipelines.CreateAzurePackage.Azure.ExecutePackage.Action(RolePipelineArgsBase arguments)
at Sitecore.Azure.Pipelines.BasePipeline.RolePipelineProcessor.Process(RolePipelineArgsBase args)
--- End of inner exception stack trace --- --- End of inner exception stack trace ---
It looks like you have incorrect version of Microsoft Azure SDK installed.
Sitecore Azure 8.0 rev. 150522 supports only version 2.5.1
Sitecore Azure 8.0 rev. 150522 Hotfix 68545-1 supports only version 2.7.1
Sitecore Azure 8.0 rev. 161110 supports only version 2.9.1
For more details, please check the following article: https://kb.sitecore.net/articles/026831