0

I want to suppress a warning in my xaml file. I applied the corresponding quick fix option to "Disable once warning by comment". However, the warning is still active. How do I correctly suppress the warning? I would like to keep the name because it tells something about the purpose of the element. (An alternative would be to remove the name and use a comment.) enter image description here

Edit

  • The issue is only valid vor Resharper version Build 8.2.0.2160.
  • After updating to 8.2.3 the suppression works correctly. (And in version 9 the warning does not seem to be active by default.) Thanks to citizenmatt.
  • The issue is still shown in the Inspection Results view, see related question Resharper: How to hide suppressed warnings in Inspection Results?
  • In this special case it makes more sense to use the Tag attribute (thanks to Mike Eason) or to use a comment to write the name instead of using a comment to suppress the warning.
Community
  • 1
  • 1
Stefan
  • 10,010
  • 7
  • 61
  • 117
  • If you are never using it, why are you declaring it? It'd be a better idea to delete the name attribute entirely. – Mike Eason Jul 08 '15 at 14:06
  • As I wrote above: I would like to keep the name because it tells something about the purpose of the element. Is there an alternative attribute that I could use instead of the name or would you recommend to use a comment? – Stefan Jul 08 '15 at 14:10
  • Yes, a comment would probably be more useful above the element than naming it. This will give you the opportunity to be more descriptive. If not, perhaps `Tag` might work for you. – Mike Eason Jul 08 '15 at 14:11
  • If you want to "tell something about the purpose of the element", use a comment, nothing else. – Clemens Jul 08 '15 at 14:26
  • What version of ReSharper are you using? I've just tried this code snippet in 9.2 EAP 3, and it doesn't show the warning at all. Do you have a repro project we can debug? – citizenmatt Jul 10 '15 at 09:33
  • Oh, I see. Sorry that I forgot to check the version. The issue has been with Build 8.2.0.2160. After updating to 8.2.3 the suppression works correctly. If you write your hint about the version as answer I'll accept it. – Stefan Jul 11 '15 at 08:49

1 Answers1

1

This looks like an issue with an older version of ReSharper. You can update to the latest version of 8.x (8.2.3) or ReSharper 9 (the 9.2 EAP has just released EAP3). It appears to have fixed the issue.

citizenmatt
  • 18,085
  • 5
  • 55
  • 60