Closed ALIENQuake closed 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.
I found a way: https://github.com/Fody/Costura
How to use:
FodyWeavers.xml
file next to csproj file with:
<?xml version="1.0" encoding="utf-8"?>
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<Costura>
<Unmanaged64Assemblies>
av_libglesv2
libHarfBuzzSharp
libSkiaSharp
</Unmanaged64Assemblies>
</Costura>
</Weavers>
The result is a single-file AoT executable!
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.
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
andIncludeAllContentForSelfExtract
. Is there any way for NativeAOT to help with including those files inside exe also?