Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to make Visual Studio auto-import necessary namespaces when implementing an interface?

When I tell Visual Studio to auto-implement an interface, it "helpfully" tries to resolve any unreferenced namespaces - by prefixing every class in those namespaces with the namespace name! Is there any way to make it just import the namespaces with a using statement up top, instead of cluttering the method and property declarations with repetitive namespace noise?

like image 542
ekolis Avatar asked May 30 '13 20:05

ekolis


1 Answers

You might want to take a look at Resharper. It does importing when you paste and it warns you and suggests when you can import namespaces. It also shows unused ones.

Here is an example:

Resharper namespace import

like image 72
Nikola Sivkov Avatar answered Nov 15 '22 12:11

Nikola Sivkov