imazen / imageflow-dotnet

The official .NET API for Imageflow, the Rust image processing and optimization engine for web servers
GNU Affero General Public License v3.0
143 stars 25 forks source link

Imageflow module not found when deployed to Azure #13

Closed Ryan-Palmer closed 4 years ago

Ryan-Palmer commented 4 years ago

I have been using Imageflow locally for development and all has been fine.

I just deployed my site to Azure and I'm getting an exception with this message:

One or more errors occurred. (Looking for "imageflow.dll" Subdir="x86", IsUnix=False, IsDotNetCore=False Before searching: Unable to load DLL 'imageflow' or one of its dependencies: The specified module could not be found. (0x8007007E) File not found: D:\home\site\wwwroot\x86\imageflow.dll File not found: D:\home\site\wwwroot\imageflow.dll at Imageflow.Bindings.NativeMethods.imageflow_context_create(UInt32 imageflow_abi_ver_major, UInt32 imageflow_abi_ver_minor) at Imageflow.Bindings.JobContextHandle.<>c.<.ctor>b__0_0() at Imageflow.Bindings.NativeLibraryLoader.FixDllNotFoundException[T](String basename, Func1 invokingOperation, IEnumerable1 customSearchDirectories) )

I think it might be related to this issue perhaps? https://github.com/imazen/imageflow/issues/330

These are the package imports from my csproj:

    <PackageReference Include="Imageflow.NativeRuntime.win-x86_64" Version="1.3.6-rc36" />
    <PackageReference Include="Imageflow.Net" Version="0.4.4" />

I browsed the deployed app's files and I can see ImageFlow.Net.dll in the wwwroot, but no x86 folder.

Ryan-Palmer commented 4 years ago

I just updated to this version but it is still the same:

<PackageReference Include="Imageflow.Net" Version="0.5.0" />

lilith commented 4 years ago

It looks like Azure is searching for the 32-bit version so you need to add that nuget package as well.

Ryan-Palmer commented 4 years ago

Aha! Sorry, I should have spotted that, I even mentioned the X86 folder was missing... All working fine now, cheers!