Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSTest is identifying wrong framework version for multi-target projects #1698

Closed
CoolDadTx opened this issue Jul 24, 2018 · 2 comments
Closed
Assignees
Labels

Comments

@CoolDadTx
Copy link

Description

I have a library that is multi-targeting .NET 4.7 and .NET Standard 2.0. It uses the newer project SDK format. I also have a unit test project associated with it that is targeting only .NET 4.7.

When using VSTS's VSTest task to run tests against this solution it reports the framework incorrectly and fails to run some tests.

Steps to reproduce

Create a solution containing a class library multi-targeting .NET 4.7 and .NET Standard 2.0.
Create a unit test project that targets .NET 4.7 and optionally .NET Core 2.1.
Run VSTest (in a VSTS build) against the solution.

This results in an output structure of:

net47\lib.dll
netstandard2.0\lib.dll
net47\unittest.dll
netcoreapp2.0\unittest.dll

Expected behavior

The reported framework it sees is incorrect and therefore it skips test assemblies it shouldn't.

Actual behavior

When it sees netcoreapp2.0\unittest.dll it reports it as Framework 2.1 so it'll get skipped when running .NET 4.7. The test runer properly says it is looking for 4.7 framework.

The more interesting scenario is when the unit test supports both. In this case it still sees the .NET Core 2.1 app as Framework 2.1. But it also causes the test runner to say it is targeting Framework 4.0 and platform x86 which causes it to skip all tests because the unit test project is .NET 4.7.

Diagnostic logs

Attached

Environment

VSTest 2.*
MS Test 1.3.2
log_7_634.zip

@cltshivash cltshivash added the bug label Jul 27, 2018
@nigurr
Copy link

nigurr commented Jul 30, 2018

@CoolDadTx
Currently we don't have .NET core test support using Visual Studio Test task. It supports only .NET desktop/full tests only.
Please refer this issue for more details - microsoft/azure-pipelines-tasks#5066

We are actively working on this to enable full support for .NET core tests however we don't have exact timelines to share at this moment.

@smadala smadala self-assigned this Aug 2, 2018
@singhsarab
Copy link
Contributor

@CoolDadTx I am closing this issue, as it belongs and is being tracked in the azure-pipelines-tasks repo. Please let me know if you have any concerns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants