Resharper: how to suppress warning “Field xy is never used” in XAML

[亡魂溺海] 提交于 2019-12-08 10:21:22

问题


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.)

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.

回答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.



来源:https://stackoverflow.com/questions/31295095/resharper-how-to-suppress-warning-field-xy-is-never-used-in-xaml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!