Skip to content

Commit 2f21e53

Browse files
Block targeting .NET 5 with NativeAOT (#66972)
The trimming settings for .NET 5 are not compatible and lead to rooting everything. Who knows what else is not compatible. We don't test this.
1 parent ce81388 commit 2f21e53

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949

5050
<!-- Fail with descriptive error message for common mistake. -->
5151
<Error Condition="$([MSBuild]::VersionLessThan('$(NETCoreSdkVersion)', '6.0.0'))" Text=".NET SDK 6+ is required for native compilation." />
52+
<Error Condition="$([MSBuild]::VersionLessThan('$(TargetFrameworkVersion)', '6.0'))" Text="For native compilation, the project needs to target .NET 6 or higher." />
5253
<Error Condition="'$(RuntimeIdentifier)' == ''"
5354
Text="RuntimeIdentifier is required for native compilation. Try running dotnet publish with the -r option value specified." />
5455
<Error Condition="'$(GeneratePackageOnBuild)' == 'true'" Text="GeneratePackageOnBuild is not supported for native compilation." />

0 commit comments

Comments
 (0)