Skip to main content
more info
Source Link
ChrisF
  • 39k
  • 11
  • 129
  • 169

Visual Studio doesn't know what code you intend to write so includes the most common namespaces for you by default in the "new class" template. This is done so you don't have to resolve all the references for every single line of new code you write.

Once you have written your basic code ifyou can safely remove the ones you don't need. You will have to add any back that you subsequently need to reference in any subsequent code you write.

If you right click and select Organize Usings > Remove and Sort it will delete any that are unused. There are also extensions that will remove and sort the namespaces automatically on saving each file.

Visual Studio doesn't know what code you intend to write so includes the most common namespaces for you by default in the "new class" template. This is done so you don't have to resolve all the references for every single line of new code you write.

Once you have written your basic code if you right click and select Organize Usings > Remove and Sort it will delete any that are unused.

Visual Studio doesn't know what code you intend to write so includes the most common namespaces for you by default in the "new class" template. This is done so you don't have to resolve all the references for every single line of new code you write.

Once you have written your basic code you can safely remove the ones you don't need. You will have to add any back that you subsequently need to reference in any subsequent code you write.

If you right click and select Organize Usings > Remove and Sort it will delete any that are unused. There are also extensions that will remove and sort the namespaces automatically on saving each file.

Source Link
ChrisF
  • 39k
  • 11
  • 129
  • 169

Visual Studio doesn't know what code you intend to write so includes the most common namespaces for you by default in the "new class" template. This is done so you don't have to resolve all the references for every single line of new code you write.

Once you have written your basic code if you right click and select Organize Usings > Remove and Sort it will delete any that are unused.