Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8228877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:36:43+00:00 2026-06-07T16:36:43+00:00

I get the following error when using the ImageResizer module on Mono in Linux:

  • 0

I get the following error when using the ImageResizer module on Mono in Linux:

Server Error in '/' Application

Argument is out of range. Parameter name: date

Description: HTTP 500. Error processing request.

Stack Trace:

System.ArgumentOutOfRangeException: Argument is out of range.
Parameter name: date
  at System.Web.HttpCachePolicy.SetLastModified (DateTime date) [0x00046] in /build/src/mono-2.10.8/mcs/class/System.Web/System.Web/HttpCachePolicy.cs:225 
  at ImageResizer.Caching.ResponseHeaders.DefaultApplyToResponseMethod (IResponseHeaders headers, System.Web.HttpContext context) [0x00000] in <filename unknown>:0 
  at ImageResizer.Plugins.Basic.NoCacheHandler.ProcessRequest (System.Web.HttpContext context) [0x00000] in <filename unknown>:0 
  at System.Web.HttpApplication+<Pipeline>c__Iterator6.MoveNext () [0x00dad] in /build/src/mono-2.10.8/mcs/class/System.Web/System.Web/HttpApplication.cs:1368 
  at System.Web.HttpApplication.Tick () [0x00000] in /build/src/mono-2.10.8/mcs/class/System.Web/System.Web/HttpApplication.cs:932 

Version information: Mono Runtime Version: 2.10.8 (tarball Sat Dec 31 02:07:23 UTC 2011); ASP.NET Version: 4.0.30319.1

Here is the debug sheet:

Image resizer diagnostic sheet      07/09/2012 14:15:41

3 Issues detected:

(Warning):  To potentially see additional errors here, perform an image resize request.


(Warning):  UrlAuthorizationModule.CheckUrlAccessForPrincipal is not supported on this runtime (are you running Mono?)
            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.

(Warning):  NoCache is only for development usage, and cannot scale to production use.
            Add DiskCache or CloudFront for production use


You are not using any paid bundles.

Registered plugins:

ImageResizer.Plugins.Basic.DefaultEncoder
ImageResizer.Plugins.Basic.NoCache
ImageResizer.Plugins.Basic.ClientCache
ImageResizer.Plugins.Basic.Diagnostic
ImageResizer.Plugins.Basic.SizeLimiting
ImageResizer.Plugins.MvcRoutingShim.MvcRoutingShimPlugin

Configuration:

<resizer>
<pipeline fakeExtensions=".ashx" />
<plugins>
<add name="MvcRoutingShim" />
</plugins>
</resizer>


Accepted querystring keys:

quality, format, thumbnail, maxwidth, maxheight, width, height, w, h, scale, stretch, crop, cropxunits, cropyunits, page, bgcolor, rotate, flip, sourceFlip, sFlip, sRotate, borderWidth, borderColor, paddingWidth, paddingColor, ignoreicc, frame, useresizingpipeline, cache, process, margin, anchor, dpi, mode, zoom, 

Accepted file extensions:

bmp, gif, exif, png, tif, tiff, tff, jpg, jpeg, jpe, jif, jfif, jfi, 

Environment information:

Running Apache on Unix 2.6.39.2 and CLR 4.0.30319.1
Trust level: Unrestricted
OS bitness: 
Executing assembly: /usr/bin/mono
IntegratedPipeline: False

Loaded assemblies:

System.Runtime.Caching                   Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System.Messaging                         Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System.Transactions                      Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
Mono.Data.Tds                            Assembly: 4.0.0.0        
Mono.Security                            Assembly: 4.0.0.0        
System.Security                          Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
Mono.CSharp                              Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
App_global.asax_199cffe9                 Assembly: 0.0.0.0        
Microsoft.Web.Infrastructure             Assembly: 1.0.0.0         File: 1.0.20105.407  
dotless.Core                             Assembly: 1.3.0.3         File: 1.3.0.3         Info: 1.3.0.3
System.Web.WebPages.Razor                Assembly: 1.0.0.0         File: 1.0.20105.407  
System.Web.WebPages.Deployment           Assembly: 1.0.0.0         File: 1.0.20105.407  
System.Web.Razor                         Assembly: 1.0.0.0         File: 1.0.20105.407  
ImageResizer                             Assembly: 3.2.3.302       File: 3.2.3.302       Info: 3-2-beta-3  Commit: 245e873
ImageResizer.Mvc                         Assembly: 3.2.3.302       File: 3.2.3.302       Info: 3-2-beta-3  Commit: 245e873
System.Web.WebPages                      Assembly: 1.0.0.0         File: 1.0.20105.407  
System.Web.Mvc                           Assembly: 3.0.0.0         File: 3.0.20105.0    
System.Web.Routing                       Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System.Web.Helpers                       Assembly: 1.0.0.0         File: 1.0.20105.407  
System.Web.Abstractions                  Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System.Web.ApplicationServices           Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System.Data.Linq                         Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System.Web.DynamicData                   Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System.ComponentModel.DataAnnotations    Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System.Xml.Linq                          Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System.Data.DataSetExtensions            Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System.Web.Extensions                    Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System.Core                              Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System.ServiceModel.Web                  Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 3.5.594.0
System.ServiceModel                      Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System.Xaml                              Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System.Runtime.Serialization             Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System.IdentityModel                     Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System.EnterpriseServices                Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System.Drawing                           Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System.Web.Services                      Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System.Data                              Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
Microsoft.CSharp                         Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
Mono.Posix                               Assembly: 4.0.0.0        
Mono.WebServer2                          Assembly: 0.4.0.0        
mod-mono-server4                         Assembly: 2.10.2.0       
Mono.Web                                 Assembly: 4.0.0.0         Info: 0.0.0.1
System.Xml                               Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System                                   Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System.Configuration                     Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1
System.Web                               Assembly: 4.0.0.0         File: 4.0.0.0         Info: 0.0.0.1
mscorlib                                 Assembly: 4.0.0.0         File: 4.0.30319.1     Info: 4.0.30319.1

Any idea what could be going wrong here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T16:36:45+00:00Added an answer on June 7, 2026 at 4:36 pm

    This is technically a bug in Mono – Both .NET 2.0 and .NET 4.0 convert the date to universal time before performing the conversion, while mono compares it to the local server time, failing to even normalize the two variables to ensure they have matching time zones.

    Mono See code

            public void SetLastModified (DateTime date)
            {
    
                if (date > DateTime.Now)
                    throw new ArgumentOutOfRangeException ("date");
    
                if (have_last_modified && date < last_modified)
                    return;
    
                have_last_modified = true;
                last_modified = date;
            }
    

    .NET (both V2 and V4) (Use ILSpy, search HttpCachePolicy with System.Web loaded)

    Or, click this link to see the disassembly.

    Psuedocode for SetLastModified(DateTime date):

    1. Convert date to universal time.
    2. Round datetime down to the nearest multiple of 10,000,000 ticks
    3. Verify that value is less than DateTime.UtcNow, and throw an exception if it’s not.
    4. If the local copy of the value has been set before and is ‘newer’ than this value, leave it alone.
    5. Otherwise set the local copy of the value to the universal time version of the parameter.

    Calling code (ImageResizer), /Core/Caching/ResponseHeaders.cs

            //Sets the Last-Modifed: header
            //The check against the current time is because  files served from another server may have a modified date in the future, if the clocks are not synchronized.
            //ASP.NET incorrectly blocks an future modified date from being sent, with an ArgumentOutOfRangeException
            DateTime utc = headers.LastModified.ToUniversalTime();
    
            if (utc != DateTime.MinValue && utc < DateTime.UtcNow) {
                context.Response.Cache.SetLastModified(utc);
            }
    

    Finding a workaround to this that won’t break something isn’t very simple. MS SQL provides LastModified values in un-specified time zones, while filesystems provide UTC but can be in the future if they’re from a remote server.

    Since incoming DateTime values often don’t include a timezone flag, normalization is very important.

    Converting to UTC, testing, converting back to local, testing, then assigning might be a valid workaround.

    I suggest editing /Core/Caching/ResponseHeaders.cs, method DefaultApplyToResponseMethod to use the following statement

        if (utc != DateTime.MinValue && utc < DateTime.UtcNow && utc.ToLocalTime() < DateTime.Now) {
            context.Response.Cache.SetLastModified(utc.ToLocalTime());
        }
    

    Please let me see if you notice a flaw in the logic; if I it works for you and passes the beta test it might be integrated into a future release.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using GWT2.0.1,when I am running web application then I get following error
You may get the following error when using incorrect URL to access VisualSVN Server
I get following error (SyntaxError): missing ] after element list when using eval function.
I am using the code as described in this question. However get following error
When using textbox.Undo(); I get the following error: Cannot Undo or Redo while undo
I am getting following error when I am trying to get WebResponse using WebResponse
I get the error list iterator not dereferencable when using the following code: bool
I am using following PHP code for trigger creation but always get error, please
I'm using the following: el = doc.createElement(input); el.size = 2%; I get the error
I get following error when deploying on test server with II6 and Framework 3.5

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.