Skip to content

Do not include forwarded --target option in build arguments#53503

Merged
tmat merged 1 commit intodotnet:release/10.0.3xxfrom
tmat:WatchTest2
Mar 19, 2026
Merged

Do not include forwarded --target option in build arguments#53503
tmat merged 1 commit intodotnet:release/10.0.3xxfrom
tmat:WatchTest2

Conversation

@tmat
Copy link
Member

@tmat tmat commented Mar 17, 2026

Fixes #52528

@tmat tmat requested a review from a team as a code owner March 17, 2026 22:07
Copilot AI review requested due to automatic review settings March 17, 2026 22:07
@tmat tmat marked this pull request as draft March 17, 2026 22:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses dotnet watch test reliability on .NET 10 (#52528) by ensuring watch-controlled MSBuild targets aren’t overridden by forwarded --target options, and adds coverage for the failing “fix-and-continue testing” scenario. It also contains a broad set of dotnet-watch refactors that convert many files to file-scoped namespaces and remove unused usings.

Changes:

  • Filter out forwarded MSBuild --target/-t options from watch build arguments so watch can control the targets it runs.
  • Add/extend dotnet watch test scenario coverage to validate reruns after an initial failing test.
  • Large formatting/refactor pass across dotnet-watch (file-scoped namespaces, indentation, unused using cleanup).

Reviewed changes

Copilot reviewed 93 out of 93 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/dotnet-watch.Tests/Web/RSATests.cs Removes unused usings (style-only).
test/dotnet-watch.Tests/Watch/NoRestoreTests.cs File-scoped namespace + formatting changes to tests.
test/dotnet-watch.Tests/Watch/GlobbingAppTests.cs File-scoped namespace + formatting changes to tests.
test/dotnet-watch.Tests/Watch/FileUpdateTests.cs Adds dotnet watch test regression test for issue #52528.
test/dotnet-watch.Tests/Watch/BuildEvaluatorTests.cs File-scoped namespace + formatting changes to tests.
test/dotnet-watch.Tests/TestUtilities/TestReporter.cs File-scoped namespace + formatting changes to test utility.
test/dotnet-watch.Tests/TestUtilities/TestConsole.cs File-scoped namespace + formatting changes to test utility.
test/dotnet-watch.Tests/TestUtilities/TaskExtensions.cs File-scoped namespace + formatting changes to test utility.
test/dotnet-watch.Tests/TestUtilities/DotNetWatchTestBase.cs Removes unused using.
test/dotnet-watch.Tests/HotReload/TerminationTests.cs File-scoped namespace + formatting changes to tests.
test/dotnet-watch.Tests/HotReload/SourceFileUpdateTests.HotReloadNotSupported.cs File-scoped namespace + formatting changes to tests.
test/dotnet-watch.Tests/HotReload/MetadataUpdateHandlerTests.cs File-scoped namespace + formatting changes to tests.
test/dotnet-watch.Tests/HotReload/MauiHotReloadTests.cs File-scoped namespace + formatting changes to tests.
test/dotnet-watch.Tests/HotReload/LoggingTests.cs File-scoped namespace + formatting changes to tests.
test/dotnet-watch.Tests/HotReload/BuildProjectsTests.cs Removes unused using.
test/dotnet-watch.Tests/ConsoleReporterTests.cs File-scoped namespace + formatting changes to tests.
test/dotnet-watch.Tests/CommandLine/SubcommandTests.cs File-scoped namespace + formatting changes to tests.
test/dotnet-watch.Tests/CommandLine/ProgramTests.cs File-scoped namespace + formatting changes to tests.
test/dotnet-watch.Tests/CommandLine/ProgramTests.HostArguments.cs File-scoped namespace + formatting changes to tests.
test/dotnet-watch.Tests/CommandLine/ProgramTests.Arguments.cs File-scoped namespace + formatting changes to tests.
test/dotnet-watch.Tests/CommandLine/LaunchSettingsTests.cs File-scoped namespace + formatting changes to tests.
test/dotnet-watch-test-browser/Program.cs Removes unused usings.
test/TestAssets/TestProjects/XUnitTestProject/XUnitTestProject.csproj Switches to version properties for xunit/test sdk references (but currently inconsistent with repo’s test asset versioning setup).
test/Microsoft.NET.TestFramework/Microsoft.NET.TestFramework.csproj Adds assembly metadata for test package versions.
src/Dotnet.Watch/dotnet-watch/Watch/StaticFileHandler.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/dotnet-watch/Watch/MsBuildFileSetFactory.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/dotnet-watch/Watch/MSBuildFileSetResult.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/dotnet-watch/Watch/DotNetWatcher.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/dotnet-watch/Watch/BuildEvaluator.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/dotnet-watch/Properties/launchSettings.json Changes debug profile args + working directory (currently machine-specific).
src/Dotnet.Watch/dotnet-watch/CommandLine/CommandLineOptions.cs Filters forwarded --target option from build args.
src/Dotnet.Watch/Web.Middleware/ResponseStreamWrapper.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/Web.Middleware/HostingStartup.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/Web.Middleware/BrowserScriptMiddleware.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/Web.Middleware/BlazorWasmHotReloadMiddleware.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/Web.Middleware/ApplicationPaths.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/Watch/Utilities/ProcessUtilities.cs Removes unused usings.
src/Dotnet.Watch/Watch/UI/TargetFrameworkSelectionPrompt.cs Removes unused usings.
src/Dotnet.Watch/Watch/UI/RestartPrompt.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/Watch/UI/PhysicalConsole.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/Watch/UI/IConsole.cs Removes outdated interface doc comment.
src/Dotnet.Watch/Watch/UI/ConsoleReporter.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/Watch/UI/ConsoleInputReader.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/Watch/Process/RunningProject.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/Watch/Process/ProjectLauncher.cs Removes unused using.
src/Dotnet.Watch/Watch/Process/ProcessSpec.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/Watch/Process/ProcessLaunchResult.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/Watch/Process/LaunchSettingsProfile.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/Watch/Process/IRuntimeProcessLauncherFactory.cs Removes unused using.
src/Dotnet.Watch/Watch/HotReload/HotReloadProjectUpdatesBuilder.cs Removes unused using.
src/Dotnet.Watch/Watch/FileWatcher/PollingDirectoryWatcher.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/Watch/FileWatcher/EventBasedDirectoryWatcher.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/Watch/Context/EnvironmentOptions.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/Watch/Context/DotNetWatchContext.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/Watch/Build/ProjectGraphUtilities.cs Removes unused using.
src/Dotnet.Watch/Watch/Build/LoadedProjectGraph.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/Watch/Build/FileItem.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/Watch/Browser/BrowserRefreshServerFactory.cs Removes unused using.
src/Dotnet.Watch/Watch/Browser/BrowserLauncher.cs Removes unused using.
src/Dotnet.Watch/Watch.Aspire/Server/WatchStatusEvent.cs Removes unused using.
src/Dotnet.Watch/Watch.Aspire/Server/WatchControlReader.cs Removes unused using.
src/Dotnet.Watch/Watch.Aspire/Program.cs Removes unused using.
src/Dotnet.Watch/Watch.Aspire/Host/AspireHostLauncher.cs Removes unused using.
src/Dotnet.Watch/HotReloadClient/Web/StaticWebAsset.cs Removes unused usings.
src/Dotnet.Watch/HotReloadClient/Web/AbstractBrowserRefreshServer.cs Removes unused usings.
src/Dotnet.Watch/HotReloadClient/Utilities/ResponseFunc.cs Removes unused usings.
src/Dotnet.Watch/HotReloadClient/Utilities/PathExtensions.cs Removes unused using.
src/Dotnet.Watch/HotReloadClient/Logging/LogEvents.cs Removes unused using.
src/Dotnet.Watch/HotReloadClient/HotReloadClients.cs Removes unused usings.
src/Dotnet.Watch/HotReloadAgent/MetadataUpdateHandlerInvoker.cs Removes unused using.
src/Dotnet.Watch/HotReloadAgent.WebAssembly.Browser/WebAssemblyHotReload.cs Removes unused usings.
src/Dotnet.Watch/DotNetWatchTasks/Utilities/RequiredMemberAttribute.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/DotNetWatchTasks/Utilities/IsExternalInit.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/DotNetWatchTasks/Utilities/CompilerFeatureRequiredAttribute.cs File-scoped namespace + formatting changes.
src/Dotnet.Watch/DotNetWatchTasks/FileSetSerializer.cs File-scoped namespace + formatting changes.
eng/Versions.props Adds XUnit VS runner version property.

@tmat tmat force-pushed the WatchTest2 branch 2 times, most recently from b881607 to 933bcc9 Compare March 18, 2026 22:33
@tmat tmat marked this pull request as ready for review March 19, 2026 15:44
@tmat
Copy link
Member Author

tmat commented Mar 19, 2026

@DustinCampbell ptal

@tmat tmat merged commit 0e67373 into dotnet:release/10.0.3xx Mar 19, 2026
29 checks passed
@tmat tmat deleted the WatchTest2 branch March 19, 2026 17: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

Successfully merging this pull request may close these issues.

3 participants