简体   繁体   中英

Remove unused references (!= usings) in C# project without Resharper?

Is there any way of removing unused references to assemblies, in a C# project, without the help of Resharper? The MSDN documentation does outline something for Visual Basic , but I couldn't find the same dialogs for C#.

There is no build in support in Visual Studio to find unused assembly references in a C# project.

A workaround is, to remove a possible unused assembly, compile the project and look if it compiles successfully. If it´s the case an unused assembly was removed. Otherwise the removed assembly was necessary and it should be added again.

To check what assemblies are used by other assemblies you can use NDepend .

For individual .cs code files, VS 2008 has: Edit, IntelliSense, Organize Usings, Remove Unused Usings (Alt-E, Alt-I, Alt-O, Alt-R). I haven't spotted anything for Projects.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM