Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Magick.NET-Q16-x64.Native.dll #291

Closed
ANavakahtsky opened this issue Aug 20, 2018 · 13 comments
Closed

Missing Magick.NET-Q16-x64.Native.dll #291

ANavakahtsky opened this issue Aug 20, 2018 · 13 comments
Milestone

Comments

@ANavakahtsky
Copy link

Hi there!

I'm trying to use your lib in .Net Core 2.0 project. I'm using Nuget for installing Magick.NET-Q16-AnyCPU 7.6.0. Unfortunately, my code fails on creating new MagickImage instance

MagickImage image = new MagickImage(ms);

with 'Missing Magick.NET-Q16-x64.Native.dll' error. This issue is similar to 235 and 25, but not identical. After the nuget package installation only Magick.NET-Q16-AnyCPU.dll is appeared in referencing project directory and output directory. However, downloaded and unzipped 'magick.net-q16-anycpu.7.6.0.nupkg' contains Magick.NET-Q16-x64.Native.dll in 'runtimes' folder.

My question is - what am I missing and where could I find this native dll? Thanks.

@dlemstra
Copy link
Owner

If you delete the issue template and don't tell me where you are running this and what the exact error is that you are receiving I am not sure If I can really help you.

@ANavakahtsky
Copy link
Author

Solved. Magick.NET-Q16-x64.Native.dll was found in obj folder (not copied to bin when project is built).

Also if you use visual studio OneClick Publish tool, be sure that you set correct RuntimeIdentifier in settings. In my case default list of options contained only 'win-x64', but magick.net awaits for one of the following: linux-x64, osx-64, win7-x64, win7-x86. You could find it in deps.json for referencing project.

"Magick.NET-Q16-AnyCPU/7.5.0": { "runtime": { "lib/netstandard20/Magick.NET-Q16-AnyCPU.dll": {} }, "runtimeTargets": { "runtimes/linux-x64/native/Magick.NET-Q16-x64.Native.dll.so": { "rid": "linux-x64", "assetType": "native" }, "runtimes/osx-x64/native/Magick.NET-Q16-x64.Native.dll.dylib": { "rid": "osx-x64", "assetType": "native" }, "runtimes/win7-x64/native/Magick.NET-Q16-x64.Native.dll": { "rid": "win7-x64", "assetType": "native" }, "runtimes/win7-x86/native/Magick.NET-Q16-x86.Native.dll": { "rid": "win7-x86", "assetType": "native" } } }

So, you need to add appropriate value manually to your PublishProfile.pubxml. After doing that, you could see Magick.NET-Q16-x64.Native.dll in publish directory. Hope this will help someone.

@JedatKinports
Copy link

JedatKinports commented Nov 14, 2018

You are a life saver @ANavakahtsky thanks!

All I had to do was add the:

 <PropertyGroup>
    <RuntimeIdentifiers>win7-x64</RuntimeIdentifiers>
  </PropertyGroup>

into my csproj file, change the runtimeidentifier in the publishing profile and now it works.

Don't know why the "win-x64" is not supported. Will this get added in the coming versions maybe? Any plans on this?

@dlemstra
Copy link
Owner

The new version of Magick.NET will use win-x64 and win-x86 instead.

@dlemstra dlemstra added this to the 7.9.0.2 milestone Nov 15, 2018
@drewlsvern
Copy link

drewlsvern commented Feb 25, 2019

Has this issue actually been fixed? Experiencing the same issue and none of the suggested solutions have solved it. I tried different nuget package versions Q8 and Q16 (x86, x64 and Any CPU) and the issue still exists.

The package works fine locally in development but when deployed to Azure I receive the following error upon application startup:
Error:
An assembly specified in the application dependencies manifest (Web.deps.json) was not found:
package: 'Magick.NET-Q8-x86', version: '7.11.0'
path: 'runtimes/win-x86/native/Magick.NET-Q8-x86.Native.dll'
Error:
An assembly specified in the application dependencies manifest (Web.deps.json) was not found:
package: 'Magick.NET-Q8-x86', version: '7.11.0'
path: 'runtimes/win-x86/native/Magick.NET-Q8-x86.Native.dll'

Current Environment:
-VS 2017
-ASP.NET Core 2.2
-Automated deployment through Azure DevOps

@dlemstra
Copy link
Owner

The file is in that folder inside the NuGet package. I have no idea why it cannot be found in Azure. Maybe the native file is not deployed?

@drewlsvern
Copy link

I guess I forgot to mention. The file and path it's looking for exists, so I don't understand why the error is happening.

@dlemstra
Copy link
Owner

Could you create a public project in azure devops that demonstrates this issue? I will be occupied for the next 25 days so take your time.

@drewlsvern
Copy link

Yeah ok, I can do that. I'm quite busy myself, so I won't be fast either.

@drewlsvern
Copy link

drewlsvern commented Feb 26, 2019

Turns out the issue was completely unrelated to your package, even though that's the error that kept coming up. It's related to the section 'Availability in Azure App Service' in this blog. This relates to running .net core 2.2 apps on Azure.

@justdan23
Copy link

Try using the SysInternals Suite app "ProcMon.exe" to watch the hosting process.

When I had this issue and used IIS to host my web app, it failed because of missing CORE_ dependency libraries missing which my Magick.NET-Q16-HDRI-x64.Native.DLL required.

ImageMagick returns the wrong message that it failed to find the DLL, but really it failed to load a dependency library. ProcMon.exe shows you which one when running it on the Server hosting IIS or Azure.

@ghost
Copy link

ghost commented Aug 16, 2019

@drewlsvern Did you manage to get it working? And if so, how? I'm currently running into it myself as well when deploying to Azure Functions on .NET Core 2.2:

The function runtime is unable to start. Magick.NET-Q16-AnyCPU: Unable to load DLL 'Magick.Native-Q16-x86.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E).


As far as I know, the file is there:

D:\home\site\wwwroot\runtimes\win-x86\native>dir
 Volume in drive D is Windows
 Volume Serial Number is 0211-4CB9

 Directory of D:\home\site\wwwroot\runtimes\win-x86\native

08/10/2019  01:40 PM        12,572,728 Magick.Native-Q16-x86.dll
07/12/2017  11:24 AM           136,488 sni.dll
               2 File(s)     12,709,216 bytes
               0 Dir(s)               0 bytes free

@ghost
Copy link

ghost commented Aug 19, 2019

Never mind, I've solved it myself.
Apparently it cannot find the above mentioned directory in Azure on its own. I had to explicitly use MagickNET.SetNativeLibraryDirectory to set it to that directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants