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

SDK 2.1.500 fails to set IsTestProject in net40 projects #2690

Closed
jnm2 opened this issue Nov 22, 2018 · 1 comment
Closed

SDK 2.1.500 fails to set IsTestProject in net40 projects #2690

jnm2 opened this issue Nov 22, 2018 · 1 comment

Comments

@jnm2
Copy link

jnm2 commented Nov 22, 2018

Here's a full repro: DotnetTestBug.zip

Projects like this worked in all SDKs up to 2.1.500 because Microsoft.NET.Test.Sdk sets <IsTestProject>true</IsTestProject>:

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

  <PropertyGroup>
    <!-- This works in all SDK versions until 2.1.500: -->
    <TargetFramework>net40</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="NUnit" Version="3.11.0" />
    <PackageReference Include="NUnit3TestAdapter" Version="3.11.0" />
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
  </ItemGroup>

</Project>

E.g. using SDK 2.1.403, you get this output for dotnet test:

Test run for C:\Users\Joseph\Desktop\DotnetTestBug\Using SDK 2.1.403\bin\Debug\net40\TestProject1.dll(.NETFramework,Version=v4.0)
Microsoft (R) Test Execution Command Line Tool Version 15.8.0
...
Test Run Successful.

Starting with SDK 2.1.500, <IsTestProject>true</IsTestProject> is no longer set. dotnet test gives:

Skipping running test for project C:\Users\Joseph\Desktop\DotnetTestBug\Using SDK 2.1.500\TestProject1.csproj. To run tests with dotnet test add "\<IsTestProject>true\<IsTestProject>" property to project file.

Note that the same <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" /> is used in both cases.
Wasn't sure if this belonged here or at https://github.com/Microsoft/vstest/issues.

Issues

  • Is it your intention to require test projects which include a net40 target to have to manually include <IsTestProject>true</IsTestProject> directly in the test csproj? Why isn't this the case for net45, since VSTest 15.9 supports net40 and net45 equally?

  • To run tests with dotnet test add "<IsTestProject>true<IsTestProject>"

    This is invalid XML. Second tag should be a closing tag: <IsTestProject>true</IsTestProject>

@livarcocc
Copy link
Contributor

This issue was moved to microsoft/vstest#1850

wli3 pushed a commit that referenced this issue Feb 7, 2020
…906.10 (#2690)

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19456.10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants