Skip to content

Azure function System.DllNotFoundException on linux #1567

@PetterKnudsen98

Description

@PetterKnudsen98

Magick.NET version

Magick.NET-Q16-x64

Environment (Operating system, version and so on)

Linux - Ubuntu 22.04.4

Description

Running .net 6 on an azure function v4 I get the following error message

System.DllNotFoundException: Unable to load shared library 'Magick.Native-Q16-x64.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libMagick.Native-Q16-x64.dll: cannot open shared object file: No such file or directory at ImageMagick.Environment.NativeMethods.X64.Environment_Initialize() at ImageMagick.Environment.NativeEnvironment.Initialize() in /_/src/Magick.NET/Native/Helpers/Environment.cs:line 65 at ImageMagick.Environment.Initialize() in /_/src/Magick.NET/Helpers/Environment.cs:line 21 at ImageMagick.MagickSettings.NativeMagickSettings..cctor() in /_/src/Magick.NET/Native/Settings/MagickSettings.cs:line 315

when executing the following code:
using var image = new MagickImage(imageStream);

My .csproj looks like this:


 <PropertyGroup>
        <TargetFramework>net6.0</TargetFramework>
        <AzureFunctionsVersion>v4</AzureFunctionsVersion>
        <MagickCopyNativeLinux>true</MagickCopyNativeLinux>
    </PropertyGroup>
    
    <ItemGroup>
        ...
        <PackageReference Include="Magick.NET-Q16-x64" Version="13.6.0" />
        ...
    </ItemGroup>

I have seen other suggest that <MagickCopyNativeLinux>true</MagickCopyNativeLinux> fixes the issue, but it doesnt seem to work for me. Is this an azure function issue, or am I just doing something wrong?

It works fine on windows, and I'm not very experience with linux.

Steps to Reproduce

  1. Run on a linux machine, only tested with ubuntu and in azure (it doesnt specify linux version)
  2. Run azure function
  3. Execute code that uses the library

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions