Skip to content

Commit f2e2f59

Browse files
committed
Force NullabilityInfoContextSupport=true in user projects
To make NRT-based model building work correctly in aggressively trimmed applications (e.g. MAUI). Fixes #27474
1 parent 5e49b24 commit f2e2f59

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/EFCore/EFCore.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ Microsoft.EntityFrameworkCore.DbSet
3131
<ProjectReference Condition="'$(BuildingByReSharper)' != 'true'" Include="..\EFCore.Analyzers\EFCore.Analyzers.csproj" PrivateAssets="contentfiles;build" />
3232
</ItemGroup>
3333

34+
<ItemGroup>
35+
<None Include="build\**\*">
36+
<Pack>True</Pack>
37+
<PackagePath>build</PackagePath>
38+
</None>
39+
</ItemGroup>
40+
3441
<ItemGroup>
3542
<None Update="Properties\CoreStrings.Designer.tt">
3643
<Generator>TextTemplatingFileGenerator</Generator>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<PropertyGroup>
3+
<!--
4+
MAUI (and other size-conscient profiles) trim the nullability attributes, causing our NRT support to break.
5+
This prevents the attributes from being trimmed.
6+
-->
7+
<NullabilityInfoContextSupport>true</NullabilityInfoContextSupport>
8+
</PropertyGroup>
9+
</Project>

0 commit comments

Comments
 (0)