Skip to content

Read the target runtime version through DAC/DBI - #136384

Merged
max-charlamb merged 1 commit into
dotnet:mainfrom
max-charlamb:dev/max-charlamb/universal-dbi-target-version
Oct 26, 2026
Merged

max-charlamb merged 1 commit into
dotnet:mainfrom
max-charlamb:dev/max-charlamb/universal-dbi-target-version

Conversation

@max-charlamb

Copy link
Copy Markdown
Member

Summary

CordbProcess::GetVersion currently reports the product version compiled into DBI, assuming that DBI and the target runtime are version-matched. That assumption does not hold for universal DBI.

Add IDacDbiInterface::GetRuntimeVersion and route CordbProcess::GetVersion through it. The cDAC implementation reads the target's existing RuntimeInfo.GetRuntimeProductVersion() contract, removes prerelease/build labels, and returns the product version as major.minor.patch.0. The native DAC retains its version-matched constants.

The DBI call uses the standard public API locking and lifetime checks and returns CORDBG_E_NOTREADY if the DAC has not initialized. Regression coverage exercises target versions different from the reader's build, prerelease/build labels, all mock target architectures, invalid versions, null output pointers, and contract failures.

cc @rcj1

Validation

Passed: Checked Windows x64 builds of mscordbi, mscordbi_universal, and mscordaccore:

& $env:ComSpec /c 'call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvars64.bat" >nul && cmake --build artifacts\obj\coreclr\windows.x64.Checked --target mscordbi mscordbi_universal mscordaccore --parallel 8'

Passed: 464 focused cDAC tests, with zero failures or skips:

& .\.dotnet\dotnet.exe test src\native\managed\cdac\tests\UnitTests\Microsoft.Diagnostics.DataContractReader.Tests.csproj -c Debug -p:RuntimeConfiguration=Debug -p:LibrariesConfiguration=Release --filter 'FullyQualifiedName~DacDbiImplTests|FullyQualifiedName~RuntimeInfoTests'

Live debugger integration and NativeAOT publishing of cDAC were not run.

Note

This pull request was prepared with GitHub Copilot.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

Use the cDAC RuntimeInfo contract for universal DBI version reporting while preserving the native DAC's version-matched behavior.

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

Copilot-Session: 711af3e2-f3d6-4f58-86ac-71b46501a42b
@max-charlamb
max-charlamb force-pushed the dev/max-charlamb/universal-dbi-target-version branch from 734b84f to 554f9a6 Compare October 25, 2026 15:32
@max-charlamb
max-charlamb merged commit 6f4424e into dotnet:main Oct 26, 2026
138 of 140 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 27, 2026
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.

3 participants