Arian Kulp's Blog
opinion, insight, and occasional code

Ticked off

Thursday, March 27, 2008 9:29 AM

I was deploying some files to IIS on a Windows Server 2003 box and I ran into quite a problem.  I kept getting an error:

Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.  Parameter name: Ticks

when I would try to hit some of the pages.  It was clearly not code related, and the stack trace indicated a problem with the compiler itself.  I found posts talking about this error when you used serialized objects between different versions of the .NET Framework (something to do with changes to the DateTime object from 1.1 to 2.0), but that clearly wasn't it.

I finally found the problem.  It's a weird one!  As I was browsing around the web folder, I noticed something funny.  The Date Modified property for the files in question were... blank!  Nada.  Nothing.  I can't figure out quite how this happened, but that was it.  I opened the files and saved them (touch).  The problem disappeared.

The only thing I could think of was the fact that the files were dragged out of a ZIP file (using the built-in ZIP Folders features of Windows 2003).  I tried this again, but did not get the same effect.  I don't know how it happened the first time, but the fix was definitely easy enough!

My guess is that the compiler gets a request for the file, and compares the Date Modified property to see if the contents have changed in order to know if it should recompile.  Obviously the check failed with a blank date.  I'm not even sure what that would mean behind the scenes.  Was it NULL?  Was it some early date that Windows supports internally but DateTime doesn't?  I don't know.  I do know that it's a quick fix if I ever see it again!

I hope this can help save someone else frustration!

UPDATE (3/31): It just happened again and I've taken a screenshot this time.  One other theory is that this is related to TortoiseSVN (a Subversion client).  I exported some files and moved them to my working directory and then couldn't even build the project due to date-related issues:

Windows Explorer showing blank




Feedback

No comments posted yet.




Post a comment






 

Please add 7 and 7 and type the answer here: