Removing all unused references from a project in Visual Studio projects

前端 未结 14 2074
北荒
北荒 2020-11-29 16:41

I just wondered if it possible within various Visual Studio versions to automatically remove all references from a project that were never been used?

In your answer,

14条回答
  •  佛祖请我去吃肉
    2020-11-29 17:32

    With Visual Studio versions 2017 and 2015, you can do this with the Code Map feature, but this feature is only available in the Enterprise Edition, not the Community or Professional versions.

    Right-click on the project node in the solution explorer and select 'Show on Code Map.' This will display your .dll as a single node in a blank graph. Right-click on that node in the Code Map and select "Show Assemblies This References." This will add an additional node called "Externals" which can be expanded to show only the assemblies that are actually referenced.

提交回复
热议问题