Resharper - 如何更改“局部变量_从未使用”是一个建议
我需要将其更改为建议而不是警告,但我找不到执行此操作的设置。
它在哪里?
这是需要通过的代码(不是编译器警告)。说的是transaction是一个没有使用的局部变量,但是这是有效的。
using (TransactionScope transaction = new TransactionScope())
{
// ...
}
I need to change this to be a suggestion and not a warning, but I cannot find the setting to do so.
Where is it?
This is the code that needs to pass (not a compilier warning). It is saying that transaction is a local variable that is not used, but this is valid.
using (TransactionScope transaction = new TransactionScope())
{
// ...
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果不需要事务变量,可以将其替换为
使用(新的 TransactionScope())
{
}
If you don't need transaction variable, you can replace it with
using (new TransactionScope())
{
}
我认为 ReSharper 不会让您将事情变成会导致编译器警告或错误的建议。我相信这是设计使然。
I don't think ReSharper lets you turn things into a suggestion that will result in a compiler warning or error. I believe this is by design.
作为问题标题的答案(不是具体示例)。
对于(8.2.1):
如果我知道如何更改它使用的特定颜色(对黑色背景不利)而不是完全禁用警告,我也会发布该警告,但它很难追踪它是哪个元素(想知道它是否存在)。有人吗?
As an answer to the headline of the question (not the specific example).
For (8.2.1):
If I knew how to change that particular color it uses (bad against black background) instead of disabling the warning entirely I would post that also but its having a hard time tracing which element it is (wondering if its even there). Anyone?