Skip to content

Commit

Permalink
Force NullabilityInfoContextSupport=true in user projects
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 dotnet#27474
  • Loading branch information
roji committed Apr 29, 2022
1 parent 5e49b24 commit e235600
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 e235600

Please sign in to comment.