Updating Microsoft.NET.Test.Sdk, Microsoft.TestPlatform.TestHost from 16.2.0 causes netcoreapp2.0 tests to stop working
See original GitHub issueDescription
Updating both packages from 16.2.0 to 16.3.0 causes this compiler error:
Error CS0234 The type or namespace name ‘TestPlatform’ does not exist in the namespace ‘Microsoft.VisualStudio’ (are you missing an assembly reference?) Tests.Core d:\NuGet\microsoft.net.test.sdk\16.3.0\build\netcoreapp1.0\Microsoft.NET.Test.Sdk.Program.cs
In an auto-generated file:
// <auto-generated> This file has been auto generated. </auto-generated>
using System;
[Microsoft.VisualStudio.TestPlatform.TestSDKAutoGeneratedCode]
class AutoGeneratedProgram {static void Main(string[] args){}}
Updating to 16.4.0 causes this exception in the Tests tab:
[12/01/2019 11:08:54.113 AM Informational] Store opened in 0.039 sec. [12/01/2019 11:08:57.245 AM Error] StreamJsonRpc.RemoteInvocationException: The following TestContainer was not found ‘Tests.Core\bin\Debug\netcoreapp2.0\Tests.Core.dll’ at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at StreamJsonRpc.JsonRpc.<InvokeCoreAsync>d__92`1.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.TestWindow.Host.TestStoreHandler.<AddSourceBasedTestsAsync>d__22.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.TestWindow.Extensibility.ILoggerExtensions.<CallWithCatchAsync>d__9.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
Steps to reproduce
- Have unit tests project targeting netcoreapp2.0 alone
- Install the following package
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="16.2.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.0.0" />
<PackageReference Include="MSTest.TestFramework" Version="2.0.0" />
- Observer tests can be discovered and successfully ran using both VS and
dotnet test
.
Expected behavior
Updating to either newer version continues to work.
Actual behavior
Updating to either newer version doesn’t work, see the error above.
Environment
- Windows 10.0.18363 Build 18363
- Visual Studio Enterprise 16.3.10
- MSTest 2.0.0 (from NuGet.org)
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (6 by maintainers)
Top GitHub Comments
Here’s a repro repo: https://github.com/jwt-dotnet/jwt/tree/temp/mstest, the branch is called
temp/mstest
where I removed xUnit and didn’t add MSTest2 yet. You will be able to repro both issues from the initial posting.The target framework ‘netcoreapp2.0’ is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy.