teobugslayer / AvaloniaCoreRTDemo

A sample showing how to use Avalonia UI and CoreRT
MIT License
102 stars 19 forks source link

The libHarfBuzzSharp.dll and libSkiaSharp.dll are required for application to start #20

Closed ALIENQuake closed 2 years ago

ALIENQuake commented 2 years ago

Hi,

I've noticed that libHarfBuzzSharp.dll and libSkiaSharp.dll are required for the application to start. I'm aware that there are some helpful options that can be used to 'include' those extra files inside .exe like IncludeNativeLibrariesInSingleFile, IncludeNativeLibrariesForSelfExtract and IncludeAllContentForSelfExtract. Is there any way for NativeAOT to help with including those files inside exe also?

teobugslayer commented 2 years ago

No, to my knowledge. They are DLL files with machine executable code, so there are no official tool to merge their code/resources. There may be some hackish way, but I would recommend against using it for production code.

I'll add the two options in the sample csproj so that people can easily choose to create a single-file distribution.

ALIENQuake commented 1 year ago

I found a way: https://github.com/Fody/Costura

How to use:

BTW: Note that at some point in time, dotnet NativeAoT compilation can be updated to handle already available 'single-file' features like IncludeNativeLibrariesInSingleFile, IncludeNativeLibrariesForSelfExtract, IncludeAllContentForSelfExtract. If that's the case, you should switch to an officially supported method since Costura is in 'maintenance' mode.