WebResource.axd and Time Zone Issue
There are some issues that you don’t know about them until they stop you somewhere!
You would know that the most common and recommended way to ship script resources in a .NET library or ASP.NET application is via .axd files in order to embed your resources into an assembly and enable the ease of deployment and usage. Often there isn’t any problem with this scenario but today I faced with a weird issue when deployed an ASP.NET 3.5 site with a script resource.
This weird issue was that my application could work without any problem on local machine but when deployed to the production, it couldn’t load JavaScript resources.
Obviously I got suspicious about WebResource.axd and thank to my event log system, I found a frequent error related to this. So viewed my resource in browser and found the exact error:
After doing an examination on this error, I could guess this is something related to date time and I looked for it on Google to find this post on Telerik blogs explaining the issue.
As is described there, this error is caused by the fact that ASP.NET cache loads and stores the assembly in the future so your resource can’t be accessed until your server hits that time.
This blog post offers a solution and there is also a simple and effective work around and that is temporary change of your machine time zone to server’s time zone.
I never seen this error when deployed various assemblies to different servers most likely because my local date time was set to a time zone similar to all those servers (Central Time)!
[advertisement] Axosoft OnTime 2008 is four developer tools in one: bug tracking, project wiki, feature management, and help desk. It manages your development process so developers can focus on coding. Installed or Hosted – Free Single-user license -- Free 30-day team trial.
3 Comments : 08.17.08
Feedbacks
@Dave:
Thank you, man :-)
Everyman Links for August 20, 2008

#1
Dave Burke
08.17.2008 @ 9:28 PM
Thanks for taking the time to write this up, Keyvan. It's exactly the issue that's affecting a number of BlogEngine.NET 1.45 users, including me. Because of your post I have a clear explanation of what was happening. You're always one step ahead of me, man. Thanks again.