How to remove unused using namespaces

后端 未结 9 1788
刺人心
刺人心 2020-12-07 22:14

I am using visual studio 2010 and was wondering if there is a way to automatically remove all the namespaces that aren\'t being used at the the top of the page e.g.

9条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 22:51

    Yes you can right click on the page and from the menu select;

    Organise Usings > Remove Unused Usings
    

    Alternatively if you prefer shortcuts, please use;

    Ctrl + R + G
    

    I am using this all the time, to clean up code, and make code compilation quicker.

    Or you can use PowerCommands to remove unused usings for entire projects

提交回复
热议问题