Skip to content

Commit

Permalink
Force NullabilityInfoContextSupport=true in user projects (#27916)
Browse files Browse the repository at this point in the history
To make NRT-based model building work correctly in aggressively
trimmed applications (e.g. MAUI).

Fixes #27474
  • Loading branch information
roji authored May 16, 2022
1 parent 23895c7 commit 813322f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/EFCore/EFCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ Microsoft.EntityFrameworkCore.DbSet
<ProjectReference Condition="'$(BuildingByReSharper)' != 'true'" Include="..\EFCore.Analyzers\EFCore.Analyzers.csproj" PrivateAssets="contentfiles;build" />
</ItemGroup>

<ItemGroup>
<None Include="buildTransitive\**\*">
<Pack>True</Pack>
<PackagePath>buildTransitive</PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<None Update="Properties\CoreStrings.Designer.tt">
<Generator>TextTemplatingFileGenerator</Generator>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!--
MAUI (and other size-conscient profiles) trim the nullability attributes, causing the EF Core NRT support to break.
This prevents the attributes from being trimmed.
-->
<NullabilityInfoContextSupport>true</NullabilityInfoContextSupport>
</PropertyGroup>
</Project>

0 comments on commit 813322f

Please sign in to comment.