Sunday, June 15, 2008

touch command for DOS/command line


Following command would simulate UNIX touch command in DOS:
copy /b test.txt +,,
(command was changed following to the comments).

ArgumentOutOfRangeException at HttpCachePolicy.UtcSetLastModified if assembly file with script control has future date relatively to the machine date


It seems that I discovered an annoying bug in the AJAX engine:
if you have a JavaScript file of script control, which is loaded through the WebResource.axd and the DLL module that embeds this JavaScript file has a file creation date, which is in the future relatively to the current machine date – you would get an unhandled ArgumentOutOfRangeException exception, raising from System.Web.HttpApplication.ExecuteStep:


System.Web.HttpCachePolicy.UtcSetLastModified(DateTime utcDate)
System.Web.HttpCachePolicy.SetLastModified(DateTime date)
System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


This would cause JavaScript error "Type NNN is undefined or null" in your browser.
The simple resolution for this problem is to "touch" the affected DLL to update it's date to current machine date time:
copy /y nul tt.txt