Removing all unused references from a project in Visual Studio projects

前端 未结 14 2077
北荒
北荒 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:18

    Some people suggested to use an awesome tool - Reference Assistant for Visual Studio. The problem is that VS2012 is the latest supported Visual Studio. But there is the way to make it work in VS2013 as well ;)

    And here is how:

    1) Download Lardite.RefAssistant.11.0.vsix

    2) Change the extension to zip: Lardite.RefAssistant.11.0.vsix -> Lardite.RefAssistant.11.0.zip

    3) Unzip and open the extension.vsixmanifest file in the text editor

    4) Find all occurences of InstallationTarget Version="[11.0,12.0)" and replace them with InstallationTarget Version="[11.0,12.0]" (note the closing bracket)

    5) Save the file and zip all files so they are on the root zip level

    6) Change the extension of the new zip to vsix

    7) Install and enjoy :)

    I've tested it with VS2013, thanks source for the tutorial

    EDIT Add to support VS 2015 Community Edition

    
    

    Meaning of the brackets

    [ – minimum version inclusive.
    
    ] – maximum version inclusive. 
    
    ( – minimum version exclusive. 
    
    ) – maximum version exclusive.
    

提交回复
热议问题