471,305 Members | 1,250 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,305 software developers and data experts.

Automatic removal of unnecessary namespace

Hi,

I am looking for a feature/functionality in VS.NET 2005 that removes using
directives/includes of unnecessary namespaces.
IDEs like Eclipse and JBuilder have had stuff like that for years and my
guess is that VS.NET 2005 has it to...but where?

Regards
/Oscar
Feb 8 '06 #1
3 2018
Hi Oscar,
I don't know of any tool that will do this but the C# compiler
automatically removes references to assemblies that are not referenced
anywhere in the code, so you don't need to worry about removing using
statements, it will not be any performance hit.

Mark Dawson
http://www.markdawson.org

"Oscar Thornell" wrote:
Hi,

I am looking for a feature/functionality in VS.NET 2005 that removes using
directives/includes of unnecessary namespaces.
IDEs like Eclipse and JBuilder have had stuff like that for years and my
guess is that VS.NET 2005 has it to...but where?

Regards
/Oscar

Feb 8 '06 #2
> Hi Oscar,
I don't know of any tool that will do this but the C# compiler
automatically removes references to assemblies that are not referenced
anywhere in the code, so you don't need to worry about removing using
statements, it will not be any performance hit.

Mark Dawson
http://www.markdawson.org
"Oscar Thornell" wrote:
Hi,

I am looking for a feature/functionality in VS.NET 2005 that removes
using
directives/includes of unnecessary namespaces.
IDEs like Eclipse and JBuilder have had stuff like that for years and
my
guess is that VS.NET 2005 has it to...but where?
Regards
/Oscar


I like to keep my using block clean too. :)

Resharper does this with it's "Optimize usings" feature and much much more.
Although the VS 2005 version isn't ready yet, it's the single best productivity
tool for me in VS.NET 2003.

Chris
Feb 8 '06 #3
On Wed, 08 Feb 2006 15:50:59 GMT, chris martin
<chris_m|NOSPAM|@caliber|SPAM|web.com> wrote:
Hi Oscar,
I don't know of any tool that will do this but the C# compiler
automatically removes references to assemblies that are not referenced
anywhere in the code, so you don't need to worry about removing using
statements, it will not be any performance hit.

Mark Dawson
http://www.markdawson.org
"Oscar Thornell" wrote:
Hi,

I am looking for a feature/functionality in VS.NET 2005 that removes
using
directives/includes of unnecessary namespaces.
IDEs like Eclipse and JBuilder have had stuff like that for years and
my
guess is that VS.NET 2005 has it to...but where?
Regards
/Oscar


I like to keep my using block clean too. :)

Resharper does this with it's "Optimize usings" feature and much much more.
Although the VS 2005 version isn't ready yet, it's the single best productivity
tool for me in VS.NET 2003.

Chris

I use Poor Man's Resharper®. I comment out all the using directives
and add them back one at a time until it builds again. As you chug
along it whines about each missing one as it finds it. Remove the
comments, rebuild, remove the comments, ...

Another item we use to help developers is to use comments after the
using directive to specify why it's even there, especially if it is
less than obvious. Here's a really bad example:

using System.Windows.Forms; // OpenFileDialog

But you get the gist. This helps the original developer and the
future maintainers manage the project without having to rely on their
photographic memories (considering some done even have film for it.)
[8-) Anyway, in a standard Window's app that comment would be
redundant, or extremely long, so you wouldn't even bother. However,
that sample comes from a MS Word add-in so it automatically answers
the question why it's there.

Ken Wilson
Seeking viable employment in Victoria, BC
Feb 8 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Joe Hesse | last post: by
1 post views Thread by Federico | last post: by
4 posts views Thread by Tarique Jawed | last post: by
29 posts views Thread by Natan | last post: by
11 posts views Thread by Dilip | last post: by
3 posts views Thread by K | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.