-
Notifications
You must be signed in to change notification settings - Fork 331
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 #1850
Comments
@livarcocc Seems like a problem with build and the way nuget is resolving the targets for net40 framework. |
Do you have a binlog to see why they are not being honored? And what do you mean by not being honored? Are they not being set? Are they being overwritten? |
Attached are the diagnostic logs for the build. |
@livarcocc Gentle ping. |
Inspecting https://www.nuget.org/packages/Microsoft.NET.Test.Sdk/15.9.0 I can only see a tfm for net45 but none for net40. Why do you believe that VSTest supports net40? |
@ViktorHofer Because VSTest 15.9 supports
|
Ok makes sense, but the nuget package doesn't have a tfm for it. Intentional? |
@ViktorHofer I guess that's my question. |
@jnm2 While we identify and fix this issue, I hope adding the tag in the csproj works for you. @ViktorHofer There was no need for a separate net40 folder, as net45 used to suffice. Will creating another folder net40 resolve this? Is that the guidance ? |
Instead of adding an additional net40 folder I would just downgrade the net45 one to net40. With that both the props and targets files will be honored. I can send a PR for that if you agree. |
Sounds fine to me. |
Downgrading to net20 if fine, as long as the props file gets picked up. |
Why? Net40 is the minimum supported version. |
@ViktorHofer That was just a sarcastic remark I assume, please go ahead make the change. :) |
@ViktorHofer, @singhsarab , I didn't mean it to be sarcastic. I just misread your earlier comment & thought you were moving it to net20, because when we tried it locally net40 did not work for us. Please go ahead and make your change. |
From @jnm2 on November 22, 2018 16:3
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>
:E.g. using SDK 2.1.403, you get this output for
dotnet test
:Starting with SDK 2.1.500,
<IsTestProject>true</IsTestProject>
is no longer set.dotnet test
gives: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 fornet45
, since VSTest 15.9 supportsnet40
andnet45
equally?This is invalid XML. Second tag should be a closing tag: <IsTestProject>true</IsTestProject>
Copied from original issue: dotnet/sdk#2690
The text was updated successfully, but these errors were encountered: