inappropriate warning on badly formed attributes


I was reluctant to report this as a bug as I haven't searched jira that thoroughly so I thought I'd just post here.

I tried cut and pasting this  first snippet of code taken from into visual studio 2008 with resharper 4.5.1231.7:

public class NotificationsConfigurationSection : ConfigurationSection
  private const string configPath = "cSharpConsultant/notifications";
  public static NotificationsConfigurationSection GetSection()
    return (NotificationsConfigurationSection)
  /*This regular expression only accepts a valid email address. */
  /*Here, we register our configuration property with an attribute.
   Note that the default value is required if we use
   the property validation attributes, which will unfortunately
   attempt to validate the initial blank value if a default isn't found*/

  public string EmailAddress
    get{ return (string)this["emailAddress"]; }
    set{ this["emailAddress"] = value; }

This seems to be invalid due to the '@' in, inasmuch as the compiler dislikes it.

Resharper immediatelly highlights both attributes as invalid for this declaration type. While there is an error, this warning does not seem to be the most appropriate.

Removing the '@' or enquoting appropriatelly removes the warning.

Please sign in to leave a comment.