[release/6.0] Force NullabilityInfoContextSupport=true in user projects #27916
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.
Description
MAUI's aggressive trimming of NRT-related attributes (dotnet/runtime#55860) doesn't allow users to use NRTs in EF Core models.
Customer impact
EF Core currently cannot be used with NRTs in MAUI. In 6.0, these attributes are silendly discarded (and an incorrect model is built); in EF Core, an exception is thrown (since NullabilityInfoContext is used).
How found
Reported by @eerhardt in #27474
Regression
No, MAUI hasn't yet been released.
Testing
Manual.
Risk
Very low - this simply adds a .props file to the EF Core nuget package.
Details
As suggested by @eerhardt, this adds a .props file to the EF Core main nuget package, which overrides the msbuild property to conserve the nullability attributes.
Fixes #27474