Using Magick.NET without installing VS 2012 C++ Redistributable EXE

Sep 2, 2014 at 8:53 AM
Hi!

I would like to use Magick.NET without installing the "Visual C++ Redistributable for Visual Studio 2012 Update 4" exe.

I don't want to be dependent our production environments, which are managed by operations team who have to install "Visual C++ Redistributable for Visual Studio 2012 Update 4" on each server and take this into consideration in the future.

Is it possible to use Magick.NET only by including the C++ related assemblies in our package?

Is it possible or would it cause any problem if I would simply add all the DLLs to my package and wouldn't use the installer exe? Or should I configure also something else?

Thank you,
Tamas
Coordinator
Sep 2, 2014 at 2:22 PM
Edited Sep 2, 2014 at 2:58 PM
I don't think it is possible to use Magick.NET without installing the "Visual C++ Redistributable for Visual Studio". You could try to copy the following files to the bin directory of your application: MSVCP110.DLL, MSVCR110.DLL, VCOMP110.DLL.

Please let me know if thats works so I can modify the documentation.
Dec 30, 2014 at 11:02 AM
Hi,

I faced the same issue and tried this suggestion - But it didnt work and am now stuck here hosting my site in GODADDY. Any help will be really really appreciated please .
Coordinator
Dec 30, 2014 at 12:52 PM
Can you explain 'does not work' in more detail? Are you getting an exception? And are you using the .NET 4.0 version of Magick.NET?
Dec 30, 2014 at 2:24 PM
Hi - Please find more details on the error.

What I'm doing - editing an image and saving to a location
Am using Magick.NET-AnyCPU.dll in my code, but in the error its mentioning Magick.NET-Q16-x86.dll

Below is the error am getting on saving.

Could not load file or assembly 'Magick.NET-Q16-x86.dll' or one of its dependencies. The specified module could not be found.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Magick.NET-Q16-x86.dll' or one of its dependencies. The specified module could not be found.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[FileNotFoundException: Could not load file or assembly 'Magick.NET-Q16-x86.dll' or one of its dependencies. The specified module could not be found.]
System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence) +0
System.Reflection.Assembly.LoadFile(String path) +71
ImageMagick.AssemblyHelper.LoadAssembly() +148

[InvalidOperationException: Failed to load embedded assembly: Could not load file or assembly 'Magick.NET-Q16-x86.dll' or one of its dependencies. The specified module could not be found.]
<MY SOLUTION>.OnLoad(EventArgs e) +264
System.Web.UI.Control.LoadRecursive() +54
System.Web.UI.Control.LoadRecursive() +145
System.Web.UI.Control.LoadRecursive() +145
System.Web.UI.Control.LoadRecursive() +145
System.Web.UI.Control.LoadRecursive() +145
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34212
Coordinator
Dec 30, 2014 at 2:29 PM
Can you switch to the x86 of Magick.NET and not use the AnyCPU version? The AnyCPU version has the x86 assembly as an embedded resource and writes this to a temporary file. That location will not have the MSVCP110.DLL, MSVCR110.DLL, VCOMP110.DLL files. I think they need to be in the same directory.
Coordinator
Jan 7, 2015 at 12:03 PM
Did you manage to get this working?
Jan 7, 2015 at 1:21 PM
No. Not yet. still not resolved.

Its working in my system. Hosted the website in IIS and tried. But not working when hosted the site in GODADDY .

Go daddy support team is not able to help in this as well unfortunately.
Coordinator
Jan 7, 2015 at 2:01 PM
Did my suggestion to switch to x86 and copying the dll files in your bin directory not work?
Feb 21, 2015 at 4:53 PM
It didnt work. I tried many things for some weeks :(

Below is the error
Failed to load embedded assembly: Could not load file or assembly 'Magick.NET-Q16-x86.dll' or one of its dependencies. The specified module could not be found.
Coordinator
Feb 22, 2015 at 10:44 AM
Thank you for getting back to this topic. Please let me know if you manage to get it working later.
May 4, 2015 at 10:19 AM
I've figured out a work around. My solution is (works for me):

If you don't want to provide the VC++ 2012 redistributeable DLLs via a setup (e.g. due to missing admin rights), you can simply provide the vcomp110.dll next to your application.exe. This DLL is used by the Magick.NET-x86.dll. To be sure which DLLs are missing, open your Magick.Net-DLL with depends.exe. It'll name you missing dependencies.

Hope this will help you somewhat.