[CSHARP-3844] Support single-file executables Created: 09/Sep/21  Updated: 31/Mar/22

Status: Backlog
Project: C# Driver
Component/s: Packaging
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Unknown
Reporter: James Kovacs Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CSHARP-3824 libmongocrypt.so is separate when bui... Closed

 Description   

If you publish an application as a single-file executable and bundle the libmongocrypt.so shared library using the IncludeNativeLibrariesForSelfExtract option:

dotnet publish -c Release -r linux-x64 -p:PublishSingleFile=true --no-self-contained -p:IncludeNativeLibrariesForSelfExtract=true

When you run the application, LibraryLoader cannot find libmongocrypt.so:

Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 'path1')
   at System.IO.Path.Combine(String path1, String path2, String path3)
   at MongoDB.Libmongocrypt.LibraryLoader.FindLibrary(IList`1 basePaths, String[] suffixPaths, String library)
   at MongoDB.Libmongocrypt.LibraryLoader..ctor()
...

This should be checked on Windows and OSX as well to determine if this is a Linux-specific problem or whether it is due to the extraction location used by single-file executables.



 Comments   
Comment by James Kovacs [ 13/Sep/21 ]

Likely also requires changes to native library loading for compression (zstd and snappy).

Generated at Wed Feb 07 21:46:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.