使用UsedImplicitlyAttribute 仍显示 ReSharper 警告

发布于 2024-10-30 05:17:57 字数 199 浏览 1 评论 0原文

ReSharper 警告我未调用私有方法。它是通过反射调用的,所以我不想删除该方法,并且(部分)为此目的设计了 UsedImplicitlyAttribute 。但即使在使用该属性装饰该方法之后,ReSharper 仍然警告我。这看起来像是一个错误,但也许我错过了一些选项(ReSharper 的选项并不少)。有谁知道我该如何解决这个问题?构建项目没有成功。

ReSharper warns me about a private method not being called. It is called through reflection, so I don't want to delete the method, and (partly) for this purpose UsedImplicitlyAttribute was designed. But ReSharper still warns me, even after decorating the method with that attribute. It seems like a bug, but perhaps I'm missing some option (ReSharper doesn't have too few of those). Does anyone have a clue how I can fix that? Building the project didn't work.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撕心裂肺的伤痛 2024-11-06 05:17:57

我假设您已阅读有关如何合并代码注释项的文档到您自己的代码中。我过去发现 R# 的这部分选项可能有点不稳定:

 R# 选项页面

有时,您复制声明的名称空间出现在列表中之前,有时需要多次访问此页面。但一旦完成,并且勾选了复选框,它就应该可以工作了。

I'm going to assume you've read the documentation on how to incorporate the Code Annotations items into your own code. I have found in the past that R# can be a little flaky with this part of the options:

R# options page

It sometimes takes more than one visit to this page before the namespace that you've copied the declarations into appears in the list. But once it does, and you tick the checkbox, it should all then work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文