Troubleshooting guide
The image resizer is self-diagnosing for the majority of issues. Visit /resizer.debug.ashx on your website to check for any issues, and to verify that you are using the latest version of all the ImageResizer dlls. If /resizer.debug.ashx is not available, you can check the version of the dlls by right-clicking on each and choosing "Properties".
To get support or use this guide, make sure you get the detailed error message from visiting the image URL directly. This guide cannot offer a solution to a generic 500 error, 404 error, or a "broken image icon", as those symptoms are far to generic to be useful.
Could not load type 'ImageResizer.InterceptModule'
Potential causes:
- You didn't copy ImageResizer.dll into the /bin folder (unlikely).
- Your website has a 'sub-site' (Application Folder) inside it. Application Folders inherit all Web.config settings from their parent sites, yet expect to have their own copies of all the dlls referenced by those settings in their own /bin folder. You can resolve this problem by (a) changing the app folder to a virtual folder, (b) adding a copy of ImageResizer.dll and plugins into the /bin folder inside that application also, or (c) using
<remove />statements in the child Web.config to cancel out the inherited<add />statements from the parent Web.config. Option (c) will disable image resizing within the sub-application.
Blank page, invalid image error in browser, or Page cannot be displayed on image URL.
If this happens when the image has a querystring:
- You are using ASP.NET MVC, but do not have the MvcRoutingShim plugin enabled. Both MVC and the ImageResizer are trying to answer the request, and corrupting the response.
If this only happens when the image doesn't have a querystring, you're running IIS6, and you have mapped individual extensions to ASP.NET instead of wildcard mapping:
Keep reading if it's a 404: File Not Found error
The type or namespace name "ImageResizer" could not be found
When using the ImageResizer from a .NET project that is not a web project you may get the following build error:
The type or namespace name "ImageResizer" could not be found (are you missing a using directive or assembly reference?)
This is caused by using a Client Profile version of .NET instead of the Full version. You can change this in Project Properties -> Application -> Target Framework. The ImageResizer requires the full version, as it is also designed to support ASP.NET usage and references the System.Web assembly (which is not part of the client profile version of .NET).
File not found
Potential causes:
- You are using the .jpg.ashx syntax, and you did not register the HttpModule properly in both places of your Web.config file.
- You are using the .jpg.ashx syntax, but you're not using a query string. You should drop the '.ashx' unless you actually want to process the file.
- You are using ASP.NET MVC, but do not have the MvcRoutingShim plugin installed.
Image appears original size
Potential causes:
- You did not register the HttpModule properly in both places of your Web.config file.
- You are using IIS 6 (or earlier), or IIS7 Classic Pipeline, and are not using the .jpg.ashx syntax, and you have not mapped all requests to the ASP.NET runtime.
- You are using ASP.NET MVC (and have conflicting routes), but do not have the MvcRoutingShim plugin installed.
- You are mistyping the querystring commands.
- The original image is smaller than the size you are requesting, and you are not using
&scale=both(The default behavior is to never upscale images, but this can be changed).
File not found only on images without a querystring
Possible causes
You are using the .ashx syntax. This is normal - you should only add the .ashx suffix if you are also adding a querystring to tell the image resizer to do something.
The images are from S3 or Sql: The S3Reader and SqlReader plugins require AspNetHostingPermission to register themselves as VirtualPathProviders. If they lack permission, they register as IVirtualImageProviders instead - but then only the image resizer can find them, and the image resizer only accepts requests with a querystring that uses one of the defined commands.
Alternatively, you may have a URL rewriting event that is affecting the path names.
Method Not Found (System.MissingMethodException)
Server Error in '/' Application.
------------------------------
Method not found: 'Void System.Web.HttpContext.RemapHandler(System.Web.IHttpHandler)'.
Exception Details: System.MissingMethodException: Method not found: 'Void
System.Web.HttpContext.RemapHandler(System.Web.IHttpHandler)'.
This error occurs when you do not have .NET 2.0 Service Pack 2 applied. No other conditions cause this error. The RemapHanlder method was added in .NET 2.0 SP2, and is required by this product. Yes, it is possible to have .NET 3, 3.5, and .NET 4 installed (and up-to-date), yet not have .NET SP2 installed. This peculiar circumstance has been verified on over 5 machines.
Server object error 'ASP 0178 : 80070005'
Server object error 'ASP 0178 : 80070005'
Server.CreateObject Access Error
The call to Server.CreateObject failed while checking permissions.
Access is denied to this object.
This error usually means that the user that the ASP website is running under does not have NTFS permissions to the ImageResizer dlls.
Right click the C:\Program Files\ImageResizingNet\v3 folder and choose Properties, Security, hit Edit, then click Add, type in the user name your website is running under, hit OK, then check "Read & Execute", and hit OK, then Apply.
On IIS6, this account is typically IUSR_ComputerName, but on IIS7, the account is usually NETWORK SERVICE or (if you're not use a default app pool), a custom user account. You'll need to open IIS and inspect the appropriate Application Pool to find out which account you need to give permissions to.
If that fails, providing Readonly access to the Everyone group should work, but that may not be acceptable if you have highly-isolated application pools which you don't want to be able to access the ImageResizer dlls files.
If you still encounter issues, perform a reinstall with COMInstaller.exe, and save the install log. If the reinstall doesn't fix the problem, send the install log to support@imageresizing.net to get help with your issue.
System.Security.SecurityException
System.Security.SecurityException: Request for the
permission of type 'System.Configuration.ConfigurationPermission,
System.Configuration, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' failed
This can occur in certain medium or low trust environments. To correct, set requirePermission="false" on the resizer section declaration in Web.config.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="resizer" type="ImageResizer.ResizerSection,ImageResizer" requirePermission="false" />
</configSections>
...