5 ms·
It would. Compiling .NET binaries to a single executable that does not require installing a runtime has been a thing for quite some time actually, but NativeAOT
by neonsunset 3y ago
It would. Compiling .NET binaries to a single executable that does not require installing a runtime has been a thing for quite some time actually, but NativeAOT definitely improves the "simple and lightweight" part of your inquiry:
JIT: dotnet publish -p:PublishSingleFile=true -p:PublishTrimmed=true
AOT: dotnet publish -p:PublishAot=true
- poulpy123 3y agoLooks interesting! Does nativeAOT works for GUI ?
- neonsunset 3y agoIt's a bit of a hit and miss as of today. CLI, back-end and natively compiled libraries (think dll/so/dylib or even .lib/.a - you can statically link NAOT binaries into other "unmanaged" code) work best, GUI - requires more work. Avalonia[0] and MAUI[1] have known working templates with it, but YMMV. [0] https://github.com/lixinyang123/AvaloniaAOT https://github.com/lixinyang123/AvaloniaAOT / https://github.com/AvaloniaUI/Avalonia/ https://github.com/AvaloniaUI/Avalonia/ [1] https://github.com/dotnet/maui https://github.com/dotnet/maui (try out with just <PublishAot>true</PublishAot> in csproj - it is known to work e.g. on iOS)
- poulpy123 3y agoThanks !