Is you have any working sample image re-sizing in ASP.NET 4.0 or 4.5. I have installed C++ Redistributable for Visual Studio 2012 (x86 or x64) and then installed https://nuget.org/packages/Magick.NET-Q16-x64/ package but i am getting,
Could not load file or assembly 'Magick.NET' or one of its dependencies. An attempt was made to load a program with an incorrect format.
If I make Enable 32-bit Application False(Yes I have set this False) then I will get,
[SEHException (0x80004005): External component has thrown an exception.]
Magick.Image.{ctor}(Image* ) +0
ImageMagick.MagickImage..ctor(String fileName) +63
ASPNET4Sample.WebForm1.Page_Load(Object sender, EventArgs e) in c:\Users\user\Documents\Visual Studio 2012\Projects\ASPNET4Sample\ASPNET4Sample\WebForm1.aspx.cs:18
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178
Here is my code,
Could not load file or assembly 'Magick.NET' or one of its dependencies. An attempt was made to load a program with an incorrect format.
If I make Enable 32-bit Application False(Yes I have set this False) then I will get,
[SEHException (0x80004005): External component has thrown an exception.]
Magick.Image.{ctor}(Image* ) +0
ImageMagick.MagickImage..ctor(String fileName) +63
ASPNET4Sample.WebForm1.Page_Load(Object sender, EventArgs e) in c:\Users\user\Documents\Visual Studio 2012\Projects\ASPNET4Sample\ASPNET4Sample\WebForm1.aspx.cs:18
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178
Here is my code,
protected void Application_Start(object sender, EventArgs e)
{
MagickNET.Initialize(AppDomain.CurrentDomain.BaseDirectory+"Bin\\ImageMagick");
}
protected void Page_Load(object sender, EventArgs e) {
if (File.Exists(Server.MapPath("~/maps.png")))
{
var image = new MagickImage(Server.MapPath("~/maps.png"));
image.Resize(50, 50);
}
}