Skip to content

Backport changes from main#53293

Open
tmat wants to merge 4 commits intodotnet:release/10.0.3xxfrom
tmat:Backports
Open

Backport changes from main#53293
tmat wants to merge 4 commits intodotnet:release/10.0.3xxfrom
tmat:Backports

Conversation

@tmat
Copy link
Member

@tmat tmat commented Mar 6, 2026

No description provided.

@tmat tmat changed the title Pin dotnet-watch TFMs (backport of https://github.com/dotnet/sdk/pull/52517) Backport changes from main Mar 6, 2026
@tmat tmat marked this pull request as ready for review March 6, 2026 19:28
@tmat tmat requested review from a team as code owners March 6, 2026 19:28
Copilot AI review requested due to automatic review settings March 6, 2026 19:28
@tmat tmat requested review from a team as code owners March 6, 2026 19:28
@tmat
Copy link
Member Author

tmat commented Mar 6, 2026

@DustinCampbell @MichaelSimons ptal

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

Backports changes from main to align the repo’s tests and dotnet-watch components with updated infrastructure and packaging conventions—most notably the TestContextSdkTestContext rename and centralized/pinned TFMs for dotnet-watch injected assets.

Changes:

  • Rename Microsoft.NET.TestFramework.TestContext to SdkTestContext and update call sites across test projects.
  • Centralize dotnet-watch injected-asset TFMs via a new TargetFrameworks.props, and update csproj/props to use the shared properties.
  • Ensure dotnet-watch forwards watched process output through the process output reporter, and add/adjust tests accordingly.

Reviewed changes

Copilot reviewed 138 out of 138 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/trustedroots.Tests/CtlFileTests.cs Switches to SdkTestContext for SDK-under-test paths.
test/dotnet.Tests/TestAssetExtensions.cs Switches to SdkTestContext for restore/global packages path.
test/dotnet.Tests/ShellShimTests/ShellShimRepositoryTests.cs Switches to SdkTestContext for DOTNET_ROOT and stage2 paths.
test/dotnet.Tests/ShellShimTests/AppHostShellShimMakerTests.cs Switches to SdkTestContext for AppHostTemplate path.
test/dotnet.Tests/PackagedCommandTests.cs Switches to SdkTestContext for test package feeds.
test/dotnet.Tests/GivenThatWeWantToBeBackwardsCompatibleWith1xProjects.cs Switches to SdkTestContext for test package feeds.
test/dotnet.Tests/GivenThatTheUserIsRunningDotNetForTheFirstTime.cs Switches to SdkTestContext for SDK version lookup.
test/dotnet.Tests/CommandTests/Workload/Install/GivenWorkloadManifestUpdater.cs Switches to SdkTestContext for feature band computation.
test/dotnet.Tests/CommandTests/VSTest/VSTestTests.cs Switches localization checks to SdkTestContext.IsLocalized().
test/dotnet.Tests/CommandTests/Tool/Update/ToolUpdateGlobalOrToolPathCommandTests.cs Switches runtime graph path lookup to SdkTestContext.
test/dotnet.Tests/CommandTests/Tool/Uninstall/ToolUninstallGlobalOrToolPathCommandTests.cs Switches runtime graph path lookup to SdkTestContext.
test/dotnet.Tests/CommandTests/Tool/Install/ToolInstallGlobalOrToolPathCommandTests.cs Switches runtime graph path lookup to SdkTestContext.
test/dotnet.Tests/CommandTests/Tool/Install/ToolInstallCommandTests.cs Switches runtime graph path lookup to SdkTestContext.
test/dotnet.Tests/CommandTests/Test/TestCommandValidationTests.cs Switches localization checks to SdkTestContext.IsLocalized().
test/dotnet.Tests/CommandTests/Test/GivenDotnetTestForwardDotnetRootEnvironmentVariables.cs Switches localization checks to SdkTestContext.IsLocalized().
test/dotnet.Tests/CommandTests/Test/GivenDotnetTestContainsMSBuildParameters.cs Switches localization checks to SdkTestContext.IsLocalized().
test/dotnet.Tests/CommandTests/Test/GivenDotnetTestContainsEnvironmentVariables.cs Switches localization checks to SdkTestContext.IsLocalized().
test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestsWithDifferentOptions.cs Switches localization checks to SdkTestContext.IsLocalized().
test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestsWithArtifacts.cs Switches to SdkTestContext for execution dir + localization checks.
test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestsForMultipleTFMs.cs Switches localization checks to SdkTestContext.IsLocalized().
test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTests.cs Switches localization checks to SdkTestContext.IsLocalized().
test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestfromCsprojWithCorrectTestRunParameters.cs Switches localization checks to SdkTestContext.IsLocalized().
test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs Switches localization checks to SdkTestContext.IsLocalized().
test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestFromDll.cs Switches localization checks to SdkTestContext.IsLocalized().
test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestFromCsprojForMultipleTFM.cs Switches to SdkTestContext for feeds + localization checks.
test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestBasedOnGlobbingFilter.cs Switches localization checks to SdkTestContext.IsLocalized().
test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsHelp.cs Switches localization checks to SdkTestContext.IsLocalized().
test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndDiscoversTests.cs Switches localization checks to SdkTestContext.IsLocalized().
test/dotnet.Tests/CommandTests/Run/RunFileTests.cs Switches to SdkTestContext for repo/toolset/nuget cache paths.
test/dotnet.Tests/CommandTests/Run/GivenDotnetRunBuildsCsProj.cs Switches localization checks + SDK version string to SdkTestContext.
test/dotnet.Tests/CommandTests/Run/GivenDotnetRootEnv.cs Switches expected DOTNET_ROOT to SdkTestContext.
test/dotnet.Tests/CommandTests/Publish/GivenDotnetPublishPublishesProjects.cs Switches localization checks to SdkTestContext.IsLocalized().
test/dotnet.Tests/CommandTests/Pack/PackTests.cs Switches localization checks to SdkTestContext.IsLocalized().
test/dotnet.Tests/CommandTests/NuGet/GivenANuGetCommand.cs Switches to SdkTestContext for test package feeds.
test/dotnet.Tests/CommandTests/New/SdkInfoProviderTests.cs Switches to SdkTestContext for dotnet root under test.
test/dotnet.Tests/CommandTests/Build/GivenDotnetBuildBuildsCsproj.cs Switches localization checks and feeds/cache to SdkTestContext.
test/dotnet.Tests/CommandFactoryTests/GivenAProjectToolsCommandResolver.cs Switches to SdkTestContext for feeds, packages root, SDK paths.
test/dotnet.Tests/CommandFactoryTests/GivenAProjectDependencyCommandResolver.cs Switches to SdkTestContext for MSBuild path + feeds.
test/dotnet.Tests/CommandFactoryTests/GivenADotnetToolsCommandResolver.cs Switches to SdkTestContext for DotnetTools path.
test/dotnet-watch.Tests/Watch/WatchOutputTests.cs Adds coverage ensuring stdout is captured in --no-hot-reload mode.
test/dotnet-watch.Tests/TestUtilities/TestOptions.cs Switches to SdkTestContext for SDK directory.
test/dotnet-watch.Tests/TestUtilities/ModuleInitializer.cs Switches to SdkTestContext for toolset lookup.
test/dotnet-watch.Tests/HotReload/AspireHotReloadTests.cs Temporarily disables unreliable assertions with issue link.
test/dotnet-watch.Tests/FileWatcher/FileWatcherTests.cs Switches to SdkTestContext for execution directory.
test/dotnet-watch.Tests/CommandLine/CommandLineOptionsTests.cs Switches to SdkTestContext for test assets directory.
test/dotnet-watch.Tests/CommandLine/BinaryLoggerTests.cs Switches to SdkTestContext for execution directory.
test/dotnet-new.IntegrationTests/Utilities.cs Switches to SdkTestContext for execution directory.
test/dotnet-new.IntegrationTests/TemplateEngineSamplesTest.cs Switches env setup + dotnet path to SdkTestContext.
test/dotnet-new.IntegrationTests/DotnetNewInstantiateTests.cs Switches localization checks to SdkTestContext.IsLocalized().
test/dotnet-new.IntegrationTests/DotnetClassTemplateTests.cs Switches env setup + dotnet path to SdkTestContext.
test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs Switches env setup + dotnet path to SdkTestContext.
test/dotnet-new.IntegrationTests/BaseIntegrationTest.cs Switches repo root/assets paths to SdkTestContext.
test/dotnet-format.UnitTests/Utilities/TestProjectsPathHelper.cs Switches test assets path to SdkTestContext.
test/dotnet-format.UnitTests/Analyzers/AnalyzerAssemblyGenerator.cs Switches NuGet.config lookup dir to SdkTestContext.
test/dotnet-MsiInstallation.Tests/Framework/VMTestBase.cs Switches toolset paths to SdkTestContext.
test/TestAssets/TestProjects/WatchApp60/WatchApp60.csproj Removes obsolete watch test asset project.
test/TestAssets/TestProjects/WatchApp60/Program.cs Removes obsolete watch test asset program.
test/Microsoft.TemplateEngine.Cli.UnitTests/BaseTest.cs Switches repo root/assets paths to SdkTestContext.
test/Microsoft.NET.ToolPack.Tests/GivenThatWeWantToPackAToolProjectWithPackagedShim.cs Switches execution directory to SdkTestContext.
test/Microsoft.NET.TestFramework/ToolsetInfo.cs Switches working dir/env injection to SdkTestContext.
test/Microsoft.NET.TestFramework/TestDirectory.cs Switches sdk version + global.json writer to SdkTestContext.
test/Microsoft.NET.TestFramework/TestContext.cs Renames test framework context type to SdkTestContext.
test/Microsoft.NET.TestFramework/TestCommandLine.cs Switches initialization entrypoint to SdkTestContext.
test/Microsoft.NET.TestFramework/TestAssetsManager.cs Switches test asset creation paths/SDK version to SdkTestContext.
test/Microsoft.NET.TestFramework/SdkTest.cs Switches toolset access to SdkTestContext.
test/Microsoft.NET.TestFramework/Commands/RunExeCommand.cs Switches env injection to SdkTestContext.
test/Microsoft.NET.TestFramework/Commands/NuGetExeRestoreCommand.cs Switches NuGet exe/cache/env injection to SdkTestContext.
test/Microsoft.NET.TestFramework/Commands/MSBuildVersionCommand.cs Switches toolset lookup to SdkTestContext.
test/Microsoft.NET.TestFramework/Commands/MSBuildCommand.cs Switches command creation to SdkTestContext.
test/Microsoft.NET.TestFramework/Commands/GetValuesCommand.cs Switches command creation to SdkTestContext.
test/Microsoft.NET.TestFramework/Commands/DotnetCommand.cs Switches dotnet host path + env injection to SdkTestContext.
test/Microsoft.NET.TestFramework/Attributes/RequiresMSBuildVersionTheoryAttribute.cs Switches MSBuild version lookup to SdkTestContext.
test/Microsoft.NET.TestFramework/Attributes/FullMSBuildOnlyTheoryAttribute.cs Switches toolset lookup to SdkTestContext.
test/Microsoft.NET.TestFramework/Attributes/FullMSBuildOnlyFactAttribute.cs Switches toolset lookup to SdkTestContext.
test/Microsoft.NET.TestFramework/Attributes/CoreMSBuildOnlyTheoryAttribute.cs Switches toolset lookup to SdkTestContext.
test/Microsoft.NET.TestFramework/Attributes/CoreMSBuildOnlyFactAttribute.cs Switches toolset lookup to SdkTestContext.
test/Microsoft.NET.TestFramework/Attributes/CoreMSBuildAndWindowsOnlyTheoryAttribute.cs Switches toolset lookup to SdkTestContext.
test/Microsoft.NET.TestFramework/Attributes/CoreMSBuildAndWindowsOnlyFactAttribute.cs Switches toolset lookup to SdkTestContext.
test/Microsoft.NET.TestFramework/Assertions/StringAssertionsExtensions.cs Switches localization checks to SdkTestContext.IsLocalized().
test/Microsoft.NET.Sdk.WorkloadManifestReader.Tests/WorkloadPackGroupTests.cs Switches dotnet root/sdk version to SdkTestContext.
test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/ResolveCompressedAssetsTest.cs Switches execution directory to SdkTestContext.
test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/ReadStaticWebAssetsManifestFileTest.cs Switches temp paths to SdkTestContext.
test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/GenerateStaticWebAssetsManifestTest.cs Switches temp paths to SdkTestContext.
test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/DiscoverPrecompressedAssetsTest.cs Switches execution directory to SdkTestContext.
test/Microsoft.NET.Sdk.StaticWebAssets.Tests/IsolatedNuGetPackageFolderAspNetSdkBaselineTest.cs Switches cache root to SdkTestContext.
test/Microsoft.NET.Sdk.StaticWebAssets.Tests/AspNetSdkBaselineTest.cs Switches repo root/nuget cache usage to SdkTestContext.
test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/BlazorWasmBaselineTests.cs Switches repo root baseline path to SdkTestContext.
test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/BlazorLegacyIntegrationTest60.cs Switches repo root baseline path to SdkTestContext.
test/Microsoft.NET.Restore.Tests/GivenThatWeWantToUseFrameworkRoslyn.cs Switches feeds/paths to SdkTestContext.
test/Microsoft.NET.Restore.Tests/GivenThatWeWantToRestoreProjectsWithPackageDowngrades.cs Switches packages folder root to SdkTestContext.
test/Microsoft.NET.Restore.Tests/GivenThatWeWantToRestoreProjectsUsingNuGetConfigProperties.cs Switches fallback/cache paths to SdkTestContext.
test/Microsoft.NET.Restore.Tests/GivenThatWeWantToRestoreDotNetCliToolReference.cs Switches NuGet cache paths to SdkTestContext.
test/Microsoft.NET.Restore.Tests/GivenThatWeWantToIgnoreObsoleteDotNetCliToolPackages.cs Switches NuGet cache paths to SdkTestContext.
test/Microsoft.NET.Publish.Tests/PublishWpfApp.cs Switches DOTNET_ROOT to SdkTestContext toolset.
test/Microsoft.NET.Publish.Tests/PublishWebApp.cs Switches DOTNET_ROOT to SdkTestContext toolset.
test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishTrimmedWindowsFormsAndWPFApps.cs Switches DOTNET_ROOT to SdkTestContext toolset.
test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAHelloWorldProject.cs Switches dotnet root copy paths to SdkTestContext.
test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAFrameworkDependentApp.cs Switches DOTNET_ROOT to SdkTestContext toolset.
test/Microsoft.NET.Build.Tests/WorkloadTests.cs Switches SDK version lookup to SdkTestContext.
test/Microsoft.NET.Build.Tests/GivenThatWeWantToUseAnalyzers.cs Switches nuget roots/sdk paths to SdkTestContext.
test/Microsoft.NET.Build.Tests/GivenThatWeWantToGenerateADepsFileForATool.cs Switches cache/toolset/env injection to SdkTestContext.
test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAWindowsDesktopProject.cs Switches SDK version lookup to SdkTestContext.
test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildASelfContainedApp.cs Switches SDK/MSBuild version lookup to SdkTestContext.
test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildANetCoreApp.cs Switches constants to SdkTestContext.
test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildALibrary.cs Switches SDK version lookup to SdkTestContext.
test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildADesktopLibrary.cs Switches toolset/nuget cache paths to SdkTestContext.
test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildADesktopExeWtihNetStandardLib.cs Switches toolset paths to SdkTestContext.
test/Microsoft.NET.Build.Tests/GivenThatWeWantDiagnosticsWhenPackageCannotBeFound.cs Switches NuGet cache paths to SdkTestContext.
test/Microsoft.NET.Build.Tests/DeleteNuGetArtifactsFixture.cs Switches NuGet cache path to SdkTestContext.
test/Microsoft.NET.Build.Tests/AspNetCoreOnFullFramework.cs Switches env injection to SdkTestContext.
test/Microsoft.NET.Build.Tests/AppHostTests.cs Switches DOTNET_ROOT to SdkTestContext toolset.
test/Microsoft.NET.Build.Containers.IntegrationTests/ToolsetUtils.cs Switches to SdkTestContext for runtime graph + package discovery.
test/Microsoft.NET.Build.Containers.IntegrationTests/TestSettings.cs Switches artifacts dir root to SdkTestContext.
test/Microsoft.NET.Build.Containers.IntegrationTests/ProjectInitializer.cs Switches packaging dir root to SdkTestContext.
test/Microsoft.NET.Build.Containers.IntegrationTests/PackageTests.cs Switches test project file root to SdkTestContext.
test/Microsoft.NET.Build.Containers.IntegrationTests/FullFramework/CreateNewImageToolTaskTests.cs Switches tool path root to SdkTestContext.
test/Microsoft.NET.Build.Containers.IntegrationTests/EndToEndTests.cs Switches NuGet.config source path to SdkTestContext.
test/Microsoft.DotNet.TemplateLocator.Tests/GivenAnTemplateLocator.cs Switches temp root to SdkTestContext.
test/Microsoft.DotNet.PackageInstall.Tests/ToolPackageUninstallerTests.cs Switches runtime graph path to SdkTestContext.
test/Microsoft.DotNet.PackageInstall.Tests/ToolPackageInstallerNugetCacheTests.cs Switches runtime graph path to SdkTestContext.
test/Microsoft.DotNet.PackageInstall.Tests/ToolPackageDownloaderTests.cs Switches dotnet root/runtime graph paths to SdkTestContext.
test/Microsoft.DotNet.PackageInstall.Tests/TestToolBuilder.cs Switches test tool output root to SdkTestContext.
test/Microsoft.DotNet.HotReload.Watch.Aspire.Tests/AspireLauncherTests.cs Switches SDK path args to SdkTestContext.
test/Microsoft.DotNet.HotReload.Test.Utilities/WatchableApp.cs Switches dotnet host path/env injection to SdkTestContext.
test/EndToEnd.Tests/VersionTests.cs Switches dotnet host path to SdkTestContext.
test/EndToEnd.Tests/ValidateInsertedManifests.cs Switches dotnet host path to SdkTestContext.
test/EndToEnd.Tests/ProjectBuildTests.cs Switches dotnet host path to SdkTestContext.
test/EndToEnd.Tests/GivenDotNetUsesMSBuild.cs Switches feeds to SdkTestContext.
test/Common/Program.cs Switches test directory root to SdkTestContext.
test/ArgumentForwarding.Tests/ArgumentForwardingTests.cs Switches dotnet host path to SdkTestContext.
src/Dotnet.Watch/dotnet-watch/Watch/DotNetWatcher.cs Routes watched process output through ProcessOutputReporter.
src/Dotnet.Watch/Web.Middleware/Microsoft.DotNet.HotReload.Web.Middleware.Package.csproj Imports pinned TFM props and uses shared middleware TFM property.
src/Dotnet.Watch/Watch/TargetFrameworks.props Adds shared/pinned TFMs for watch-injected assemblies/middleware.
src/Dotnet.Watch/Watch/RuntimeDependencies.props Imports shared TFMs; parameterizes target paths and TFMs.
src/Dotnet.Watch/HotReloadAgent/Microsoft.DotNet.HotReload.Agent.Package.csproj Imports pinned TFM props and uses shared agent TFM property.
src/Dotnet.Watch/HotReloadAgent.Host/Microsoft.DotNet.HotReload.Agent.Host.Package.csproj Imports pinned TFM props; uses shared multi-TFM list + source-build condition update.
src/Dotnet.Watch/DotNetDeltaApplier/Microsoft.Extensions.DotNetDeltaApplier.csproj Imports pinned TFM props; uses shared multi-TFM list + source-build condition update.
src/Dotnet.Watch/BrowserRefresh/Microsoft.AspNetCore.Watch.BrowserRefresh.csproj Imports pinned TFM props and uses shared middleware TFM property.

tmat and others added 4 commits March 6, 2026 11:46
…2836)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tmat <41759+tmat@users.noreply.github.com>

Fix
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