Search code examples
asp.net-mvc-4image-resizingimageresizer

ImageResizing Not Working In Hosting


I have an asp.net mvc project. I installed imageresizing nuget packages. It's working in local.

When I published to my hosting then it's not working. I set IIS situation integrated and classic but still didn't work. I couldn't solve, can you help please? Thanks.

The following definitions are exist in web.config

 <resizer>
    <plugins>
      <add name="MvcRoutingShim" />
      <add name="DiskCache" />
      <add name="SimpleFilters" />
      <add name="PrettyGifs" />
    </plugins>
  </resizer>


<modules runAllManagedModulesForAllRequests="true">
      <add name="ImageResizingModule" type="ImageResizer.InterceptModule" />
    </modules>

Solution

  • The self-diagnostics page at /resizer.debug explains the configuration issues present on your hosting environment

    Image resizer diagnostic sheet 24.11.2014 22:15:04

    2 Issues detected:

    • (Critical): Grant the website SecurityPermission to call UrlAuthorizationModule.CheckUrlAccessForPrincipal Without this permission, it may be possible for users to bypass UrlAuthorization rules you have defined for your website, and access images that would otherwise be protected. If you do not use UrlAuthorization rules, this should not be a concern. You may also re-implement your security rules by handling the Config.Current.Pipeline.AuthorizeImage event.

    • DiskCache(ConfigurationError): Not working: Your NTFS Security permissions are preventing the application from writing to the disk cache Please give user read and write access to directory "D:\inetpub\adafirin.com\www\imagecache" to correct the problem. You can access NTFS security settings by right-clicking the aformentioned folder and choosing Properties, then Security.