Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-3824

libmongocrypt.so is separate when building a single-file executable

    • Type: Icon: Task Task
    • Resolution: Works as Designed
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: 2.12.0
    • Component/s: Field Level Encryption
    • Labels:
      None
    • Environment:
      Linux

      I am publishing my application as a single-file self-contained (minus runtime) executable like this:

       

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

      Note that the "--no-self-contained" only means the runtime is not bundled, but dependencies still are due to the "-p:PublishSingleFile=true" flag.

       

      Ignoring pdb files, after I run the above command I can see the following contents under bin\Release\net5.0\linux-x64\publish:

      MyExecutableProject
      libmongocrypt.so
      

      The issue is that the mongocrypt dependency is not bundled within the MyExecutableProject executable. If I delete it manually I get the following error when executing MyExecutableProject:

       

      Error:
        An assembly specified in the application dependencies manifest (MyExecutableProject.deps.json) was not found:
          package: 'MongoDB.LibMongocrypt', version: '1.2.0'
          path: 'runtimes/linux/native/libmongocrypt.so'
      

       

      libmongocrypt.so was not present as a separate file on version 2.11, tested with 2.11.6.

            Assignee:
            james.kovacs@mongodb.com James Kovacs
            Reporter:
            de.felix.koenig@gmail.com Felix König
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: