のは23:59:59より大きい値を処理できないようConfigurationElement
です。TimeSpan
回避策はありますか?サブクラスTimeSpan
化して、新しいものを作成することTimeSpanValidatorAttribute
も機能しますか?数分から数日の期間を処理する必要があります。
次の構成セクションを使用しています
[ConfigurationProperty("SequenceRolloverDOSCompare", IsRequired = true)]
[TimeSpanValidator(MinValueString = "0:0:00", MaxValueString = 10675199.02:48:05.4775807", ExcludeRange = false)]
public TimeSpan SequenceRolloverDOSCompare
{
get
{
return (TimeSpan)base["SequenceRolloverDOSCompare"];
}
}
configは次のようになります。
<SequenceRolloverPolling SequenceRolloverDOSCompare="2:00:00:00" />
与えるConfigurationErrorsException : The value of the property 'SequenceRolloverDOSCompare' cannot be parsed. The error is: 2:00:00:00 is not a valid value for TimeSpan.
またはこれ:
<SequenceRolloverPolling SequenceRolloverDOSCompare="48:00:00" />
与えるOverflowException : The TimeSpan could not be parsed because at least one of the hours, minutes, or seconds components is outside its valid range