Deploying Asp.Net to a different time zone, Temporal Future Shock! Specified argument was out of the range of valid values. Parameter name: utcDate

by Jon 17. December 2010 09:57

You would have never of thought it but if you compile ASP.NET in a different timezone you could cause yourself some temporal problems.  I recently discovered that parts of ASP.NET are date specific and if you compile an ASP.NET application in one timezone (The UK), and deploy to another timezone (California) you may find that your web application won’t work correctly until the time catches up.  Its all to do with the date stamp in the assemblies, when you install your application onto a server in california the timestamps on the assembly files may be in the future and parts of the ASP.NET framework will refuse to load them.  Just by waiting 8 hours for time to catch up the problem will resolve itself!  Its defiantly worth saying this doesn’t effect all server setups I had no problems with a customer running server 2008 in a different timezone, I only came across this problem with an AJAX enabled system when a customer was running server 2003, but I haven’t had time to test different scenarios

I installed the application the AJAX was ‘working’ however nothing was styling correctly

I viewed the source of the page and started debugging by copying the WebResource.xsd url into different tab, I was surprised to see the following error:

Server Error in '/' Application.

Specified argument was out of the range of valid values.
Parameter name: utcDate

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.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: utcDate
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.

I returned to the system after 8 hours and the site was working and the error was gone! Be careful out there, this was a fully patched server 2003!

Tags: , , , , , , ,

asp.net | Deploy | development | General | IIS | Maintanance | TechSupport | vs2010


500.19 Internal Server Error, There is a duplicate ‘system.web.extensions /scripting /scriptResourceHandler’

by Jon 29. October 2010 22:22

Http Error 500.19 There is a duplicate ‘system.web.extensions/scripting/scriptResourceHandler’

After shipping your asp.net 2.0, 3.0 or 3.5 application to a new server you get the following error:

There is a duplicate ‘system.web.extensions/scripting/scriptResourceHandler’

Don’t worry you haven’t done anything wrong, your are just trying to ship to a new server that has been configured to use .NET 4.0 as the default, and lucky for you it is a quick and simple configuration change to fix it:

Change Application Pool to .Net Framework v2.0

  • Open Internet Information Services (IIS) Manager
  • Goto the Application Pools screen
  • Open the Application Pool offending web application(s) are using
  • Change the Application Pool to use dotnet 2.0 instead of .net 4.0
  • Hard Refresh the erroring page with a <Ctrl> F5

Tags: , , , , , , , ,

asp.net | Deploy | IIS | TechSupport


The zip file containing your deployment may have been corrupted, or your Reference Hint Paths are wrong

by Jon 6. October 2010 15:53

So you zip up your package, and you download it to your customers site to install onto there server and you get the following error:

Security Exception

Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file

Exception Details: System.Secuity.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=, Culture=neutral

Your deployment may have been corrupted

You know nothing has changed the system works find on your test server, your laptop and everywhere else its just broken here, and nothing major has changed since the last release!  What can be wrong? One of two things:

Your dll references and Hint Paths could be wrong, open up your Project files and look for incorrect hint paths causing your solution to be compiled with a range or dlls causing your very own dll hell.  Or alternatively your zip and dlls could have been corrupted in some way, either way its not good.

Hopefully this post will help you find the root of your problems, the obscure error means your installation is corrupted in some way..




The Asp.Net Vulnerability and DotNetBlogEngine.Net

by Jon 20. September 2010 21:34


Looking at ScottGu's Post and DotNetBlogEngine.Net configuration it looks like DotNetBlogEngine may be one of the Web applications that is vulnerable in the out of the box configuration (I'm not 100% sure and I cant find anyone on the dotnetblogengine forums about it).  Its still not especially clear but it looks like we need to take these steps to take to secure our blogs.  Better safe than sorry, until the underlying problem is fixed?

Replace the Custom Errors in Web.Config

<customErrors mode="RemoteOnly" defaultRedirect="~/error404.aspx" />
   <error statusCode="404" redirect="error404.aspx" />


<customErrors mode="On" redirectMode="ResponseRewrite" defaultRedirect="~/fail.aspx" />


Then Add a new File Called fail.aspx to the root folder:

<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="System.Security.Cryptography" %>
<%@ Import Namespace="System.Threading" %>

<script runat="server">
   void Page_Load() {
      byte[] delay = new byte[1];
      RandomNumberGenerator prng = new RNGCryptoServiceProvider();

      IDisposable disposable = prng as IDisposable;
      if (disposable != null) { disposable.Dispose(); }

<head runat="server">
        An error occurred while processing your request.

For more information on the Problem and details of the fix please look at scott's post

Tags: , ,

asp.net | BlogEngine | scottgu

Powered by BlogEngine.NET
Original Design by Laptop Geek, Adapted by onesoft, and finally some tiny tweaks by JonAlb