Skip to content

Conversation

@idg10
Copy link
Collaborator

@idg10 idg10 commented Jun 5, 2025

Major changes:

  • Unit tests now run on net9.0 (and continue to run on net8.0, net472, and UWP)
  • Removed .net6.0 and .net7.0 targets from test runner because those runtimes are out of support
  • Removed dependency on MSBuild.SDK.Extras

Minor changes:

  • Various small code changes to appease the SDK 9.0.300 era code analyzers
  • Resolves TaskScheduler sometimes runs timed tasks synchronously. #2207 (because we first saw that bug occur when running tests on .NET 9.0)
  • Solution adds new Debug (UWP) configuration, because we need to disable building of the UWP Test Runner project in order for dotnet build to work with its default Debug configuration

idg10 added 29 commits October 21, 2024 14:10
TBC, but I don't think this is useful to us (since Rx is not intended to be consumed by non-.NET WinRT code) and it's kicking in only because we have types that implement IDisposable.

It's possible that this is only happening because of an SDK bug.
This is attempting to generate code for a scenario we don't support (use of Rx types from non-.NET languages via WinRT). It causes a lot of diagnostic messages, and may also be causing unproductive code bloat.
This mostly entails using collection expression syntax. We were already using it in a lot of places, but with the 9.0 SDK we saw a load of extra diagnostics for this in test projects
Turns out the configuration setting is ignored by everything except pack!
…DotNetCoreCli task seems intent on rewriting quotes in ways I don't want.
…l Debug

Without this change, running `dotnet build` from the command line fails as it attempts to build the UWP test runner project, something that dotnet build can't actually build.
There were situations in which Scheduling a timed work item in the TaskPoolScheduler would occasionally end up running the work before returning from Schedule. This was not intentional, and occurred due small window in which a Delay task could complete before a continuation was attached to it. (This only seems to have started happening in .NET 9.0.)

#2207
Also I realised there were bugs in the relevant tests: they had Asserts inside the work item callbacks, but those assertions would fire on threads not known to the unit test framework, and nothing in the test code attempted to await the work and rethrow back on the test thread. So I restructured these to move all of the assertions back into the main test bodies.
VS decided after a few minutes idle that it had changed its mind about some diagnoser results, so I had to change some more settings.
@idg10 idg10 self-assigned this Jun 5, 2025
@idg10 idg10 added the [area] Rx label Jun 5, 2025
Copy link
Collaborator

@HowardvanRooijen HowardvanRooijen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great ADR.

idg10 and others added 3 commits June 5, 2025 19:03
Fix typo in ADR

Co-authored-by: Howard van Rooijen <[email protected]>
We had a workaround for xunit/xunit#2703 but this has been fixed, so by upgrading we can remove the workaround.

This is good because it turns out the workaround doesn't work if you have a machine with a dev drive user via an alias folder. (Some parts of the build system resolve to the unaliased dev drive path, and so our <Compile Remove> didn't actually match the thing it's meant to be removing!)
@idg10 idg10 merged commit 656f625 into main Jun 6, 2025
7 checks passed
@idg10 idg10 deleted the feature/net90-sdk branch June 6, 2025 11:54
idg10 added a commit that referenced this pull request Aug 29, 2025
Unit tests now run on net9.0 (and continue to run on net8.0, net472, and UWP)
Removed .net6.0 and .net7.0 targets from test runner because those runtimes are out of support
Removed dependency on MSBuild.SDK.Extras
@idg10 idg10 linked an issue Sep 2, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TaskScheduler sometimes runs timed tasks synchronously. Deadlock when using TaskPoolScheduler recursively.

3 participants