开发者

Unused References in c# application

I develop WinForms applications. How can I understand which references that I have added to my application are in use, and which ones are unused?

If I don't remove unu开发者_如何学JAVAsed references, will they degrade my application performance?


Unused references will not cause any performance loss when you run your application. Your references are used at compile time to look up unknown symbols.

It is just extra information given to your compiler; telling it where to look for symbols. When the compilation is over, it is no longer needed.


One way to see if reference is used by your code (without external tools) is to simply remove that reference and compile.

Used in the code? You'll get nice error message, just add it back.

Not used? Compile succeed and you can leave it removed.

If the reference is to your own project in the same Solution and there are few classes only, you can right click each class in Visual Studio and choose Find All References - if something is referencing that class you'll see it.


You can use extensions for VS. You can find them in VS Gallery. You can try this one: Reference Assistant

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜