MSTest +多个框架目标=悲伤

问题描述 投票:0回答:1

我有一些MSTest项目,既需要定位netcoreapp1.1,也需要定位诸如netcoreapp3.0等较新的对象>

我已经尝试了建议的大多数事情:

https://www.meziantou.net/mstest-v2-testing-against-multiple-frameworks.htm

How to properly unit test a .NET project with multiple target frameworks, given implementation differences among targets?

https://developercommunity.visualstudio.com/content/problem/215235/test-container-not-found-when-trying-to-run-tests.html

但是我的结果总是:

  • dotnet test仅运行netcoreapp3.0目标。 netcorapp1.1netcoreapp2.0均未拾取
  • VS2019运行零个测试目标,崩溃并显示错误:
StreamJsonRpc.RemoteInvocationException: The following TestContainer was not found 'C:\Projects\fact\collection\src\Fact.Extensions.Collection.Tests\bin\Debug\netcoreapp1.1\Fact.Extensions.Collection.Tests.dll'
   at StreamJsonRpc.JsonRpc.<InvokeCoreAsync>d__96`1.MoveNext()

我有一些MSTest项目,既需要同时针对netcoreapp1.1,也需要针对诸如netcoreapp3.0这样的较新版本,我已经尝试了建议的大多数方法:https://www.meziantou.net/mstest-v2 -...

c# mstest
1个回答
0
投票

[在撰写此问题时,我推断最新的Microsoft.NET.Test.Sdk(在撰写本文时为16.4.0)可能与以前的框架不兼容。我通过两种方法都验证了这一理论:

© www.soinside.com 2019 - 2024. All rights reserved.