Visual Studio 2010-无法访问的代码检测器 [英] Visual studio 2010 - Unreachable code detector

查看:86
本文介绍了Visual Studio 2010-无法访问的代码检测器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在基于FW4的Web应用程序中使用VS2010

我正在寻找能够指出无法访问的代码的东西(免费)(未使用的方法,未使用的变量等)

我已经安装了生产力电动工具"和"Web Essentials"扩展,但它们并不能(或者我不知道要使它们如此流行).

有人可以帮助我吗?

我忘了说VS2010 SP1:)

hi everyone,

i''m using VS2010 in a webapplication based on FW4

i''m looking for something (free) able to point out unreachable code ( unused methods, unused variable, etcc)

I''ve installed "productivity power tools" and "web essentials" extensions but they don''t (or i don''t know hot to make them do) act as i need.

anyone that could help me?

i forgot to say VS2010 SP1 :)

推荐答案

Resharper [ ^ ]可能是最好的选择,但是如果您认为一种方法如果未使用它,则可以为它提供Obsolete属性,并且每次使用它时都会收到一个编译器警告.这可以帮助人们断奶,并确保在您不再收到警告时可以安全删除:
Resharper[^] is probably the best bet, but if you think a method is unused, you can give it the Obsolete attribute, and you will get a compiler warning each time it is used. This can help to wean people off them, as well as ensuring it it safe to delete when you no longer get warnings:
/// <summary>
/// Load settings from config file
/// </summary>
[Obsolete]
public void LoadSettings()
    {
    ...
    }


这篇关于Visual Studio 2010-无法访问的代码检测器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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