Skip to content

[automated] Merge branch 'main' => 'release/dnup'#54734

Open
github-actions[bot] wants to merge 1082 commits into
release/dnupfrom
merge/main-to-release/dnup
Open

[automated] Merge branch 'main' => 'release/dnup'#54734
github-actions[bot] wants to merge 1082 commits into
release/dnupfrom
merge/main-to-release/dnup

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

I detected changes in the main branch which have not been merged yet to release/dnup. I'm a robot and am configured to help you automatically keep release/dnup up to date, so I've opened this PR.

This PR merges commits made on main by the following committers:

  • Copilot
  • baronfel
  • jankratochvilcz
  • nagilson
  • kotlarmilos
  • SimaTian
  • Evangelink
  • marcpopMSFT
  • jjonescz
  • lewing
  • github-actions[bot]
  • SimonZhao888
  • MichaelSimons
  • samuelsandri
  • dsplaisted
  • AlesProkop
  • tmat
  • dotnet-maestro[bot]
  • emaf
  • JoeRobich
  • DonnaChen888
  • invalid-email-address
  • NikolaMilosavljevic
  • jonathanpeppers
  • ViktorHofer
  • lbussell
  • mmitche
  • SolalPirelli
  • akoeplinger
  • jeffhandley
  • simonrozsival
  • danmoseley
  • dotnet-bot
  • joeloff
  • JamieMagee
  • akhera99
  • JanProvaznik
  • dkurepa
  • vseanreesermsft
  • mthalman
  • trungnt2910
  • krwq
  • JeremyKuhne
  • MiYanni
  • ellahathaway
  • dotnet-sb-bot
  • zivkan
  • corngood
  • Alex-Sob

Instructions for merging from UI

This PR will not be auto-merged. When pull request checks pass, complete this PR by creating a merge commit, not a squash or rebase commit.

merge button instructions

If this repo does not allow creating merge commits from the GitHub UI, use command line instructions.

Instructions for merging via command line

Run these commands to merge this pull request from the command line.

git fetch
git checkout main
git pull --ff-only
git checkout release/dnup
git pull --ff-only
git merge --no-ff main

# If there are merge conflicts, resolve them and then run git merge --continue to complete the merge
# Pushing the changes to the PR branch will re-trigger PR validation.
git push https://github.com/dotnet/sdk HEAD:merge/main-to-release/dnup
or if you are using SSH
git push git@github.com:dotnet/sdk HEAD:merge/main-to-release/dnup

After PR checks are complete push the branch

git push

Instructions for resolving conflicts

⚠️ If there are merge conflicts, you will need to resolve them manually before merging. You can do this using GitHub or using the command line.

Instructions for updating this pull request

Contributors to this repo have permission update this pull request by pushing to the branch 'merge/main-to-release/dnup'. This can be done to resolve conflicts or make other changes to this pull request before it is merged.
The provided examples assume that the remote is named 'origin'. If you have a different remote name, please replace 'origin' with the name of your remote.

git fetch
git checkout -b merge/main-to-release/dnup origin/release/dnup
git pull https://github.com/dotnet/sdk merge/main-to-release/dnup
(make changes)
git commit -m "Updated PR with my changes"
git push https://github.com/dotnet/sdk HEAD:merge/main-to-release/dnup
or if you are using SSH
git fetch
git checkout -b merge/main-to-release/dnup origin/release/dnup
git pull git@github.com:dotnet/sdk merge/main-to-release/dnup
(make changes)
git commit -m "Updated PR with my changes"
git push git@github.com:dotnet/sdk HEAD:merge/main-to-release/dnup

Contact .NET Core Engineering (dotnet/dnceng) if you have questions or issues.
Also, if this PR was generated incorrectly, help us fix it. See https://github.com/dotnet/arcade/blob/main/.github/workflows/scripts/inter-branch-merge.ps1.

Evangelink and others added 30 commits May 28, 2026 10:28
Resolves the four explicit TODOs in the Microsoft.Testing.Platform pipe
protocol implementation called out in PR #50625's follow-up review, and
hardens handshake message handling.

Changes in src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs:
- 'RunAsync' is now guarded with an 'Interlocked.Exchange' so callers
  can no longer invoke it more than once on the same instance.
- Reworded the 'GetSupportedProtocolVersion' comment to explain why we
  return an empty string instead of throwing: it lets the handler
  surface a structured 'HandshakeFailure' rather than crashing the
  process via 'FailFast' in 'OnRequest'.

Changes in src/Cli/dotnet/Commands/Test/MTP/TestApplicationHandler.cs:
- 'OnHandshakeReceived' no longer throws 'KeyNotFoundException' when
  'SupportedProtocolVersions' is missing entirely. A new resource
  'DotnetTestMissingHandshakeProtocolVersions' surfaces that case
  distinctly from 'DotnetTestIncompatibleHandshakeVersion'.
- Added a 'GetRequiredHandshakeProperty' helper used by 'ExecutionId',
  'Architecture', 'Framework', 'HostType', and 'InstanceId', replacing
  direct dictionary indexing that would throw KeyNotFoundException.
- 'OnFileArtifactsReceived' validates 'FullPath' is non-empty instead
  of using the '!' null-suppression operator.
- 'OnSessionEventReceived' now rejects messages received in help mode
  (same pattern as other handlers) and validates 'SessionUid'.

Added resources in CliCommandStrings.resx:
- 'DotnetTestMissingHandshakeProtocolVersions'
- 'DotnetTestMissingRequiredMessageProperty'
- 'RunAsyncCalledMoreThanOnce'

xlf files were regenerated by the build (state='new').

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Consolidate runner-name matching in global.json branch via TryResolveRunner
  helper to avoid duplicating the case-insensitive comparisons.
- Make pre-existing global.json tests hermetic by passing an explicit
  testRunnerEnvironmentValue: null so they cannot be silently disabled by a
  DOTNET_TEST_RUNNER value set in the developer/CI environment.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Round 2:
- Route missing/empty required handshake properties through HandshakeFailure
  instead of throwing (which previously caused FailFast).
- Reject mismatching handshake info via HandshakeFailure rather than throwing.
- Validate non-nullable required properties on TestResultMessages
  (InstanceId, Uid, DisplayName) with structured error; null-safe Exceptions.
- Validate FileArtifactMessage.FullPath.
- Reject TestSessionEvent without SessionType, validate SessionUid, and
  surface unknown event types via a localized error instead of an
  ArgumentOutOfRangeException.
- Reject duplicate handshake on the same pipe connection.
- Guard TestApplication.RunAsync against being invoked more than once.

Round 3:
- OnHandshakeReceived now returns bool. When the handler rejects the
  handshake (unsupported version, missing required properties, mismatching
  info, ...) TestApplication.OnRequest replies with an empty negotiated
  version so Microsoft.Testing.Platform stops sending further messages on
  the connection. This avoids a cascade of KeyNotFoundException /
  NullReferenceException in TerminalTestReporter (which only indexes
  _assemblies[executionId] after a TestHost handshake has been recorded).
- Move InstanceId validation in front of the _handshakeInfo write so a
  failed TestHost handshake leaves the handler state clean.
- Validate top-level ExecutionId on every non-handshake message before
  comparing it to the handshake's ExecutionId.
- Validate DiscoveredTestMessage.Uid / DisplayName.
- Guard discovery / result / artifact handlers with _receivedTestHostHandshake
  so a non-TestHost handshake cannot lead the terminal reporter into an
  unkeyed _assemblies lookup.
- Reword DotnetTestMissingRequiredMessageProperty to "missing or empty".

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
The underlying infrastructure issue (Helix installing the x64 .NET runtime
on arm64 macOS machines, causing 'incompatible architecture' dlopen failures
when running multi-TFM tests against the previous .NET runtime) was fixed in
eng/restore-toolset.sh by commits 6d4031f (Rosetta 2 detection +
reinstall) and bba0cc1 (use TARGET_ARCHITECTURE for cross-arch installs).

This re-enables the remaining dotnet test tests that were skipped on OSX
because of that infrastructure issue:

  - GivenDotnetTestBuildsAndDiscoversTests.DiscoverProjectWithMSTestMetaPackageAndMultipleTFMsWithTests_ShouldReturnExitCodeSuccess
  - GivenDotnetTestBuildsAndRunsHelp.RunHelpOnMultipleTestProjects_ShouldReturnExitCodeSuccess
  - GivenDotnetTestBuildsAndRunsTests.RunningWithGlobalPropertyShouldProperlyPropagate
  - GivenDotnetTestBuildsAndRunsTestsForMultipleTFMs.RunMultipleProjectWithDifferentTFMs_ShouldReturnExitCodeGenericFailure
  - GivenDotnetTestBuildsAndRunsTestsForMultipleTFMs.RunProjectWithMultipleTFMs_ShouldReturnExitCodeGenericFailure
  - GivenDotnetTestBuildsAndRunsTestsForMultipleTFMs.RunProjectWithMultipleTFMs_ParallelizationTest_RunInParallelShouldFail
  - GivenDotnetTestBuildsAndRunsTestsForMultipleTFMs.RunProjectWithMSTestMetaPackageAndMultipleTFMs_ShouldReturnExitCodeGenericFailure

Also fixes RunTestProjectSolutionWithRuntimeOption_ShouldReturnExitCodeSuccess,
which hardcoded 'x64' as the runtime architecture. On arm64 macOS the x64
runtime is not installed, which produced the 'have arm64, need x86_64'
mismatch in the test logs. It now derives the runtime architecture from the
current process the same way the neighbouring tests do.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds a new TestInProgressMessages IPC message type (serializer id 10) so that the test platform can notify the SDK when a test starts. The SDK already has rendering machinery for in-progress tests (TestProgressState, TestNodeResultsState, AnsiTerminalTestProgressFrame, including the '... and X more' trimming) but it was dead because the protocol carried no 'test started' event and ShowActiveTests was never enabled.

Changes:

* IPC layer: new TestInProgressMessages model + TLV serializer, registered with id 10. Back-compat is preserved by the TLV format (unknown field ids are skipped) and NamedPipeServer skipUnknownMessages, so old SDKs paired with new MTPs continue to work and vice-versa.

* Handler: TestApplicationHandler.OnTestInProgressReceived forwards each event to TerminalTestReporter.TestInProgress(assembly, tfm, arch, executionId, instanceId, uid, displayName).

* State: TestNodeResultsState now keys running tests by (instanceId, uid) and tracks a completed set, so a stale in-progress notification arriving after the matching test result cannot resurrect a 'running' entry. Retries (new instanceId) are still surfaced correctly.

* Default-on: ShowActiveTests is enabled when AnsiMode == AnsiIfPossible and progress is not suppressed, so it stays off in CI, --no-ansi, --no-progress and LLM environments.

* Tests: round-trip + serializer id assertion for the new serializer, plus stale-add suppression / retry handling for TestNodeResultsState.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…string properties

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
Adds the standalone `--use-current-runtime` (alias `--ucr`) option to the Microsoft.Testing.Platform code path of `dotnet test` so that restore and build target the current runtime, matching the behavior already available on `dotnet build`, `dotnet publish`, `dotnet run`, and `dotnet store`.

The option is also added to the mutex with `--test-modules` (which globs DLLs and does not invoke MSBuild) so that combining the two now fails with a clear `GracefulException`.

Resolves #50369. Replaces #53515.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Self-contained WPF apps crash due to missing ijwhost.dll.
The fix is tracked in dotnet/wpf#11664.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Jan Jones <janjones@microsoft.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: DonnaChen888 <v-donnachen@microsoft.com>
…c paths

The codeflow from dotnet/dotnet updated how asset metadata OriginalItemSpec
is tracked, now using full \obj\... paths instead of relative
obj\... paths. Update all affected baseline JSON files to match.
…pability

The ShowActiveTests option is set based on the requested AnsiMode, but
TerminalTestReporter may decide at runtime to disable progress (e.g. when
stdout is redirected, console is non-TTY, or ANSI codes aren't accepted).
In that case the incoming TestInProgress events would still allocate and
update TestNodeResultsState even though nothing can ever be rendered.

Compute an effective _showActiveTests in the ctor as
_options.ShowActiveTests && showProgress and use it to gate both the
AddRunningTestNode and RemoveRunningTestNode paths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
# Conflicts:
#	src/Cli/dotnet/Commands/Test/MTP/TestApplicationHandler.cs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reset patterns:
- global.json
- NuGet.config
- eng/Version.Details.xml
- eng/Version.Details.props
- eng/common/*
SimonZhao888 and others added 18 commits June 10, 2026 11:06
Reset patterns:
- global.json
- NuGet.config
- eng/Version.Details.xml
- eng/Version.Details.props
- eng/common/*
…ts (fixes Blazor WASM blazor.webassembly.js 404) (#54649)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… publish assets (#54518)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…keys to test templates (#54698)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Aleš Prokop <ales.prokop.dev@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Merging, the failure seems to be a transient telemetry test, unrelated
Co-authored-by: Jan Kratochvil <jan.kratochvil@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ation (#54653)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
Reset patterns:
- global.json
- NuGet.config
- eng/Version.Details.xml
- eng/Versions.props
- eng/common/*
- CODEOWNERS
@SimonZhao888

Copy link
Copy Markdown
Member

@copilot resolve the merge conflicts in this pull request

Copilot AI and others added 2 commits June 12, 2026 01:12
# Conflicts:
#	eng/Version.Details.props
#	eng/Version.Details.xml
#	eng/Versions.props
#	eng/build.ps1
#	eng/configure-toolset.ps1
#	eng/configure-toolset.sh
#	eng/pipelines/templates/jobs/sdk-build.yml
#	eng/restore-toolset.ps1
#	eng/restore-toolset.sh
#	global.json
#	src/Cli/Microsoft.DotNet.Cli.Definitions/Commands/Test/TestCommandDefinition.MicrosoftTestingPlatform.cs
#	src/Cli/dotnet-aot/AotSourceFiles.props
#	src/Cli/dotnet-aot/NativeEntryPoint.cs
#	src/Cli/dotnet/Commands/Test/MTP/TestApplicationHandler.cs
#	src/Cli/dotnet/Commands/xlf/CliCommandStrings.cs.xlf
#	src/Cli/dotnet/Commands/xlf/CliCommandStrings.de.xlf
#	src/Cli/dotnet/Commands/xlf/CliCommandStrings.es.xlf
#	src/Cli/dotnet/Commands/xlf/CliCommandStrings.fr.xlf
#	src/Cli/dotnet/Commands/xlf/CliCommandStrings.it.xlf
#	src/Cli/dotnet/Commands/xlf/CliCommandStrings.ja.xlf
#	src/Cli/dotnet/Commands/xlf/CliCommandStrings.ko.xlf
#	src/Cli/dotnet/Commands/xlf/CliCommandStrings.pl.xlf
#	src/Cli/dotnet/Commands/xlf/CliCommandStrings.pt-BR.xlf
#	src/Cli/dotnet/Commands/xlf/CliCommandStrings.ru.xlf
#	src/Cli/dotnet/Commands/xlf/CliCommandStrings.tr.xlf
#	src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hans.xlf
#	src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hant.xlf
#	src/Cli/dotnet/Extensions/ParseResultExtensions.cs
#	src/Cli/dotnet/Parser.cs
#	src/Cli/dotnet/Telemetry/TelemetryClient.cs
#	src/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompat.Task/Microsoft.DotNet.ApiCompat.Task.csproj
#	src/Compatibility/GenAPI/Microsoft.DotNet.GenAPI.Task/Microsoft.DotNet.GenAPI.Task.csproj
#	src/Microsoft.CodeAnalysis.NetAnalyzers/tests/Microsoft.CodeAnalysis.NetAnalyzers.UnitTests/Microsoft.NetCore.Analyzers/Usage/MissingShebangInFileBasedProgramTests.cs
#	src/Tasks/Common/ConflictResolution/ResolvePackageFileConflicts.cs
#	src/Tasks/Common/Resources/Strings.resx
#	src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.CrossGen.targets
#	test/Microsoft.NET.Build.Tasks.Tests/GivenTasksUseAbsolutePaths.cs
#	test/Microsoft.NET.Publish.Tests/GivenThatAPublishedDepsJsonShouldContainVersionInformation.cs
#	test/dotnet-aot.Tests/AotParserTests.cs
#	test/dotnet-aot.Tests/NativeEntryPointTests.cs
#	test/dotnet-aot.Tests/dotnet-aot.Tests.csproj
#	test/dotnet-new.IntegrationTests/DotnetNewTestTemplatesTests.cs
#	test/dotnet.Tests/CommandTests/Project/Convert/DotnetProjectConvertTests.cs
#	test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestsWithArtifacts.cs
#	test/dotnet.Tests/CommandTests/Test/TerminalTestReporterTests.cs
#	test/dotnet.Tests/CommandTests/Test/TestApplicationHandlerTests.cs
#	test/dotnet.Tests/CommandTests/Test/TestCommandParserTests.cs
#	test/dotnet.Tests/CommandTests/Test/snapshots/MTPHelpSnapshotTests.VerifyMTPHelpOutput.verified.txt

Co-authored-by: SimonZhao888 <133954995+SimonZhao888@users.noreply.github.com>
Co-authored-by: SimonZhao888 <133954995+SimonZhao888@users.noreply.github.com>

Copilot AI commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved all merge conflicts in commit 8a1f433001.

The conflicts were resolved by:

  • Version/infrastructure files (global.json, eng/Version.Details.xml, eng/Version.Details.props, eng/Versions.props): kept release/dnup values
  • Code/source/test files (48 files including eng/build.ps1, eng/configure-toolset.*, eng/restore-toolset.*, src/Cli/dotnet-aot/*, XLF localization files, and test files): took main's changes

The PR branch now has a proper merge commit with release/dnup as parent 1 and main as parent 2.

@github-actions github-actions Bot added the sdk-diagnostic-docs-needed Indicates that a PR introduces new diagnostic codes, which must be documented over at dotnet/docs label Jun 12, 2026
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

📋 SDK Diagnostic Documentation Reminder

This PR introduces 1 new SDK diagnostic code:

  • NETSDK1241

Action Required

Please ensure that documentation for this diagnostic is added or updated in the dotnet/docs repository at:

Each diagnostic should have:

  • A clear description of the error/warning
  • Possible causes
  • Recommended solutions
  • Code examples where applicable

Thank you for helping keep our documentation up to date! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sdk-diagnostic-docs-needed Indicates that a PR introduces new diagnostic codes, which must be documented over at dotnet/docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.