I am writing my own custom configuration section and have a ConfigurationProperty defined in a ConfigurationElement like so:
[ConfigurationProperty(\"startTi
I wonder if the indirection from the property requires a double-escaping of the contents. If yes, then instead of:
"\\d{2}:\\d{2}:\\d{2}"
use:
@"\\d{2}:\\d{2}:\\d{2}"
Ordinarly I would think that is too much, but give it a try.
Try to define the default value that will pass the validation:
[ConfigurationProperty("startTime", IsRequired = false, DefaultValue = "00:00:00")]
[RegexStringValidator(@"\d{2}:\d{2}:\d{2}")]
public string StartTime
{
get
{
return (string) this["startTime"];
}
set
{
this["startTime"] = value;
}
}