Resharper:如何抑制警告“从未使用字段 xy"在 XAML 中 [英] Resharper: how to suppress warning "Field xy is never used" in XAML

查看:31
本文介绍了Resharper:如何抑制警告“从未使用字段 xy"在 XAML 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的 xaml 文件中取消警告.我将相应的快速修复选项应用于禁用一次评论警告".然而,警告仍然活跃.如何正确抑制警告?我想保留这个名称,因为它说明了元素的用途.(另一种方法是删除名称并使用注释.)

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

编辑

  • 该问题仅在 vor Resharper 版本 Build 8.2.0.2160 中有效.
  • 更新到 8.2.3 后,抑制工作正常.(在第 9 版中,默认情况下警告似乎没有激活.)感谢 Citizenmatt.
  • 该问题仍显示在检查结果视图中,请参阅相关问题 Resharper:如何在检查结果中隐藏被抑制的警告?
  • 在这种特殊情况下,使用 Tag 属性(感谢 Mike Eason)或使用注释来写入名称而不是使用注释来抑制警告更有意义.

推荐答案

这看起来像是旧版 ReSharper 的问题.您可以更新到最新版本的 8.x (8.2.3) 或 ReSharper 9(9.2 EAP 刚刚发布了 EAP3).似乎已经解决了这个问题.

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.

这篇关于Resharper:如何抑制警告“从未使用字段 xy"在 XAML 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆