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
Running dotnet test in libraries failing to execute net462 targets #68384
Comments
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis Issue DetailsRunning the following command from the base of the runtime repo
Will produce the warning
Tests run as expected when using the
This is an issue for my workflow, since running cc @ViktorHofer
|
Tagging subscribers to this area: @dotnet/runtime-infrastructure Issue DetailsRunning the following command from the base of the runtime repo
Will produce the warning
Tests run as expected when using the
This is an issue for my workflow, since running cc @ViktorHofer
|
I can repro that failure and found the culprit by emitting diagnostic files:
@nohwnd @MarcoRossignoli is that a known issue? We can't invoke net462 tests with vstest anymore. Happening with a 6.0.100 SDK. diag.txt |
Not a known issue, the logs you post are probably not the culprit: I think this is, you can see that there are no runners or discoverers on the bottom. What is also curious is that somewhere in the middle the resolve changes from xunitnet462 to xunitnet452:
|
@nohwnd thanks for the initial investigation. Curious, who would be the best person to look into this more closely? I currently have no idea how to make progress and unblock our devs. |
@ViktorHofer Me or someone from our team. Putting this on my work item list. |
@ViktorHofer The issue is that both xunit.runner.visualstudio (what TestPlatform uses to run tests), and xunit.runner.console copy xunit.runner.utility.net452.dll into the output folder. In project xunit.runner.console is newer, and ends up copying a version of the dll that causes version mismatch when loading the dll (according to fusion log). When I compare a project that uses the same versions, I get a working test project, and I can see from binlog that the dll is copied from xunit.runner.visualstudio, and NOT from xunit.runner.console: This works: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net462</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.0-preview-20201201-01" />
<PackageReference Include="xunit.runner.console" Version="2.4.2-pre.22">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.4.2-pre.22" />
</ItemGroup>
</Project> I tried to figure out why is the broken project prefers the xunit.console runner, but I could not figure that out. Hopefully it will give you a starting point. :) |
I can also repro the same issue in my project when I add explicit reference to:
Which I see happen in few targets in runtime repo and which I originally thought is the issue, but it is not. It only has the same end result. The dll is overwritten by a version that is unexpected. |
@ericstj the upgrade from xunit.runner.console/2.4.1 to 2.4.2 broke xunit.runner.visualstudio which relies on xunit.runner.utility.*/2.4.1. The impact is that @clairernovotny could we release a new version of xunit.runner.visualstudio that depends on xunit.runner.utility.*/2.4.2 or would it make more sense to revert the assembly upgrade in xunit.runner.console/2.4.2? |
We can release a new version. Any chance you could submit a PR with the dependency update? |
Absolutely. Will get to it later today. |
Fixes #68384 For a detailed explanation why updating the xunit.runner.visualstudio fixes .NETFramework dotnet test and VSTest invocation please see the above linked issue.
Wohooo, the final fix for this issue is out: #68863. Thanks @nohwnd and @clairernovotny for your help. |
* Fix VSTest and dotnet test broken on .NETFramework Fixes #68384 For a detailed explanation why updating the xunit.runner.visualstudio fixes .NETFramework dotnet test and VSTest invocation please see the above linked issue.
Running the following command from the base of the runtime repo
Will produce the warning
Tests run as expected when using the
Test
target:This is an issue for my workflow, since running
dotnet test
solution-wide will skip all our netfx targets.cc @ViktorHofer
The text was updated successfully, but these errors were encountered: