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

Invalid arguments generated for msbuild on .NET 9 and 17.12 preview #10423

Closed
Kaliumhexacyanoferrat opened this issue Nov 7, 2024 · 2 comments

Comments

@Kaliumhexacyanoferrat
Copy link

Kaliumhexacyanoferrat commented Nov 7, 2024

Describe the bug

Running dotnet test with .NET 9 VSTest 17.12.0-preview-24453-04 (x64) will generate an invalid configuration for MSBuild which either causes the command to fail or to ignore arguments.

Steps To Reproduce

  1. Clone https://github.com/Kaliumhexacyanoferrat/GenHTTP/tree/feature/kestrel
  2. Run dotnet build GenHTTP.sln -c Release
  3. Run dotnet test GenHTTP.sln -d --no-build --collect:"XPlat Code Coverage" -c Release -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover

Expected behavior

Tests are executed and the solution is not built.

Actual behavior

Tests are executed but the solution is built, ignoring the --no-build flag. Diagnostics file used by the process is:

Logging Vstest Diagnostics in file: /home/runner/work/GenHTTP/GenHTTP/--no-build

Putting the flag -c Release directly after the solution name will cause MSBuild to fail stating that there are multiple projects built (because -c is appended to the diagnostics log and MSBuild is instructed to test GenHTTP.sln Release). So it seems that one argument is consumed and appended to the diagnostics log path but should not.

Additional context

<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.2" />

See this CI run as an example: https://github.com/Kaliumhexacyanoferrat/GenHTTP/actions/runs/11727877110/job/32670005611

Can reproduce both on Windows and Linux (GitHub runner).

Project is configured for both .NET 8 & .NET 9.

@Evangelink Evangelink transferred this issue from microsoft/testfx Nov 11, 2024
@Evangelink
Copy link
Member

Transferring to VSTest. Given the explanation it's likely to be a bug in the SDK integration of VSTest.

@Kaliumhexacyanoferrat
Copy link
Author

Can close this - -d expects a file path or name to a diagnostics log file, so it sure consumed the next argument passed.

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