Visual Studio Remove Unused References With Organize Usings

2:08:00 am 0 Comments

Remove unused references in visual studio by organize usings command

When we create a new website or project in visual studio, several namespace references are added in code behind by default.

Visual studio Remove unused references using organize using

It's always advisable to remove all unused usings and references from code behind for better performance.

We can follow steps mentioned below to remove all unused usings and references.

FOR C# APPLICATIONS OR PROJECTS

Open code behind of the page u want to remove unused references,
Right click > Organize Usings > Remove Unused Usings




All unused usings will be removed as shown below.



FOR VB.NET APPLICATIONS AND PROJECTS

Right click on My Project in solution explorer > Select Open.


Select References tab and click on unused references button.


Check the check box for references you want to remove and click on remove.


Hope this helps.

0 comments: