Fix Nullable<T> detection inside MetadataLoadContext to emit proper BamlRecordType - #11816
Open
h3xds1nz wants to merge 3 commits into
Open
Fix Nullable<T> detection inside MetadataLoadContext to emit proper BamlRecordType#11816h3xds1nz wants to merge 3 commits into
h3xds1nz wants to merge 3 commits into
Conversation
h3xds1nz
marked this pull request as draft
August 4, 2026 11:04
h3xds1nz
marked this pull request as ready for review
August 4, 2026 16:43
Member
|
Oh, my experiment failed and I left some junk on your PR — turns out my WpfRuntime project hasn't been upgraded to .NET 11 yet. I'm still maintaining the older version and haven't added multi-targeting support. So when building, anything outside |
Member
Author
|
@lindexi No worries, yeah this assumes that the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11815
Description
Fixes detection of Nullable types on SDK-style builds where a new API for detecting
Nullable<T>types was added (dotnet/runtime#124216).GetNullableUnderlyingTypechecks theIsGenericTypefor us.Customer Impact
Well, the customer impact depends on how many years does it take for a PR to land in dotnet/wpf.
Regression
Regression for SDK-style projects. Otherwise this has been the case since
MetadataLoadContextis available (which is the time when WPF was opensourced).Testing
The repro included in the original issue. Using
dotnet buildfor any TFM after swapping PBT in SDK.Also verified builds in Visual Studio which use the net472 build of PBT.
Risk
There shouldn't be any, though I'm unsure at the moment if we can surface a non-in-box
Typeto check on inside WPF code so that such code would need to override this new method to not receive a randomNotSupportedException. Eitherway, all inbox types ship with overrides and if a custom type override wants to work with nullables, they should override it.Microsoft Reviewers: Open in CodeFlow