Skip to content

Instantly share code, notes, and snippets.

@kant2002
Created August 31, 2022 19:53
Show Gist options
  • Save kant2002/d12decc58bf1693756ec08c21713570f to your computer and use it in GitHub Desktop.
Save kant2002/d12decc58bf1693756ec08c21713570f to your computer and use it in GitHub Desktop.
Windows Forms NativeAOT
Application.Run(new Form() { Text = "Hello NativeAOT!" });
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<!-- only difference from template -->
<_SuppressWinFormsTrimError>true</_SuppressWinFormsTrimError>
<PublishAot>true</PublishAot>
</PropertyGroup>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment