Overview
Publishing with dotnet publish -p:PublishAot=true (NativeAOT) currently leaves the libgit2 native DLL/so/dylib in the output folder, preventing a true single-file distribution. If LibGit2Sharp exposed NativeLibrary / DirectPInvoke metadata to let the linker embed a static libgit2, NativeAOT users could ship just one executable.
Problems
- NativeAOT disables the single-file bundler, so
IncludeNativeLibrariesForSelfExtract is ignored and the native library is always emitted next to the .exe.
- Distributors must ship extra files, and there is no self-extract logic at runtime.
Request
Please add official support for statically linking libgit2 when LibGit2Sharp is used with NativeAOT (for example, by publishing a package that injects the required NativeLibrary metadata).
Reference
Overview
Publishing with
dotnet publish -p:PublishAot=true(NativeAOT) currently leaves the libgit2 native DLL/so/dylib in the output folder, preventing a true single-file distribution. If LibGit2Sharp exposedNativeLibrary/DirectPInvokemetadata to let the linker embed a static libgit2, NativeAOT users could ship just one executable.Problems
IncludeNativeLibrariesForSelfExtractis ignored and the native library is always emitted next to the .exe.Request
Please add official support for statically linking libgit2 when LibGit2Sharp is used with NativeAOT (for example, by publishing a package that injects the required
NativeLibrarymetadata).Reference
https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/interop