Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/6.0] Force NullabilityInfoContextSupport=true in user projects #27916

Merged
merged 1 commit into from
May 16, 2022

Conversation

roji
Copy link
Member

@roji roji commented Apr 29, 2022

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

@roji roji changed the base branch from main to release/6.0 April 29, 2022 13:08
@roji roji force-pushed the NullabilityInfoContextSupport branch from 5a579a0 to f2e2f59 Compare April 29, 2022 13:11
src/EFCore/EFCore.csproj Outdated Show resolved Hide resolved
@roji roji force-pushed the NullabilityInfoContextSupport branch 2 times, most recently from fb4c053 to a86243e Compare April 29, 2022 16:21
To make NRT-based model building work correctly in aggressively
trimmed applications (e.g. MAUI).

Fixes dotnet#27474
@roji roji force-pushed the NullabilityInfoContextSupport branch from a86243e to e235600 Compare April 29, 2022 16:27
Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm. Thanks!

@dougbu
Copy link
Member

dougbu commented May 13, 2022

@roji has this been submitted to Tactics for inclusion in 6.0.6❔

@roji roji requested a review from a team May 15, 2022 10:52
@roji
Copy link
Member Author

roji commented May 15, 2022

@dougbu thanks for the reminder - you're right, this slipped through.

@AndriySvyryd AndriySvyryd changed the title Force NullabilityInfoContextSupport=true in user projects [release/6.0] Force NullabilityInfoContextSupport=true in user projects May 15, 2022
@roji roji merged commit 813322f into dotnet:release/6.0 May 16, 2022
@roji roji deleted the NullabilityInfoContextSupport branch May 16, 2022 15:29
@AndriySvyryd AndriySvyryd added this to the 6.0.6 milestone May 16, 2022
@ajcvickers ajcvickers removed this from the 6.0.6 milestone Oct 3, 2022
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.

Consider setting NullabilityInfoContextSupport=true in EF's NuGet package
5 participants