views:

38

answers:

1

When I have a property within a class such as:

''' <summary>
'''   Customer IP address. 
''' </summary>
''' <remarks>
'''   Optional parameter. Required if traffic analysis is enabled.
'''   tools provided. 
'''   Format Specification: IPv4 Addresses only.
'''   Maximum length: 15 characters.
''' </remarks>
<ValidatorComposition(CompositionType.And, Ruleset:="TrafficAnalysis")> _
<NotNullValidator(MessageTemplate:="IP address is required for traffic analysis.", Ruleset:="TrafficAnalysis")> _
<StringLengthValidator(7, RangeBoundaryType.Inclusive, 15, RangeBoundaryType.Inclusive, MessageTemplate:="IP address must be between 7 and 15 characters in length.", Ruleset:="TrafficAnalysis")> _
<RegexValidator("^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}$", MessageTemplate:="Invalid IP address.", Ruleset:="TrafficAnalysis")> _
Public Property IPAddress() As String
    Get
        Return _IPAddress
    End Get
    Set(ByVal value As String)
        _IPAddress = value
    End Set
End Property

The .net compiler returns the following warning.

XML comment block must immediately precede the language element to which it applies. XML comment will be ignored.

Since I have all warning as errors, the project won't compile. Anyone out there who has experienced this issue and knows a fix?

The entlib validators are obviously important. I have toyed with moving the validation to the web.config using the entlib validation configuration tool but have not had much success with that and have been able to use the entlib validators the way I have above.

Entlib v4.1 and vs 2008.

A: 

Try using a single pair of <>'s with commas to separate the attributes, rather than putting each attribute in its own <>.

see here

Jason Williams