The_Black_Smurf
The_Black_Smurf

Reputation: 5269

Can Visual Studio remove explicit namespace from declarations?

I just converted 10 years of code from VB to c# and I'm currently trying to clean the converted code.

Is there a way to tell Visual Studio to replace existing class name for a shortest definition that would consider the using statements previously defined?

ex: I would like this line

System.Data.Common.DbDataAdapter myDbDataAdapter;

to be converted to

DbDataAdapter myDbDataAdapter;

if the using System.Data.Common; is in the file.

Upvotes: 0

Views: 217

Answers (1)

Dan Hayman
Dan Hayman

Reputation: 89

Yeah, that was my thought too. Give the trial of ReSharper a go. The format file functions has options to do this. You can even to it for whole solutions.

http://www.jetbrains.com/resharper/

Upvotes: 1

Related Questions