Why 10675199.02:48:05.4775807 TimeSpan Maximum for CompilationSection?

I was looking at the metadata for System.Web.Configuration.CompilationSection, and noticed the following attribute on the TimeSpan BatchTimeout property:

[TimeSpanValidator(MinValueString = "00:00:00", 
 MaxValueString = "10675199.02:48:05.4775807")]

Could someone explain why this is the allowed max value? TimeSpan itself has an upper limit, so why would there be another value validation, and why this number?

Answers


That is exactly the maximum value of TimeSpan. Quoting MSDN for TimeSpan.MaxValue:

The value of this field is equivalent to Int64.MaxValue ticks. The string representation of this value is positive 10675199.02:48:05.4775807.


I think the accepted answer does not fully answer the question. It is indeed the same maximal value. And it's no coincidence. But why is the definition:

[TimeSpanValidator(MinValueString = "00:00:00", MaxValueString = "10675199.02:48:05.4775807")]

and not something like:

[TimeSpanValidator(TimeSpan.Zero, TimeSpan.MaxValue)]

?

Well simply put, it's because Attributes don't allow the second kind of definitions. They only allow compile time constants, because they are meta data that's compiled into the assembly.


Need Your Help

Is GAE Channel API secure? And what is the underlying implementation?

python security google-app-engine https channel-api

I'm using GAE + Python to create an application that needs to send real-time updates of sensitive data to clients and I wanted to know if the App Engine Channel API is secure or not. Will using HTT...

NullPointerException VideoView and MediaController on Fragment in android

android nullpointerexception show fragment mediacontroller

I am developing Galaxy Tab 10.1 app by using honeycomb 3.1 and i have a videoview and mediacontroller in fragment on the right side. I defined VideoView and MediaController in Layout xml file and