473,586 Members | 2,702 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2100
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3649
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc. And i have things to offer, and to request. And a lot of ideas, but who needs them.... here's an example (from type_struct.py):
9
2003
by: Joe Hesse | last post by:
/***** When I run the following program (gnu C++) the address of the automatic object 'a' in f() is the same as the address of the automatic object 'b' in main(). I conclude that 'a' in f() is the same object as 'b' in main(). Is this an error or an optimization? Thank you,
1
2226
by: Federico | last post by:
I want to create an automatic log system that writes to a ofstream (the logfile) all the output sent to screen. I tried to make a class COutput with the operator << overloaded for the different kind of data types, but a problem arrived when I tried to use io manipulators such as setprecision. I have this in class COutput: COutput&...
2
5074
by: David Richards | last post by:
Hi, Hopefully someone can help me. I have setup a continuous form that displays customer names and addresses. I have then place a txt box on the form header. Using the onChange event I've setup some VBA to update the record source on the form based on the data entered into the text box. The problem I have is that when if I type some...
4
9011
by: Tarique Jawed | last post by:
Alright I needed some help regarding a removal of a binary search tree. Yes its for a class, and yes I have tried working on it on my own, so no patronizing please. I have most of the code working, even the removal, I just don't know how to keep track of the parent, so that I can set its child to the child of the node to be removed. IE - if...
29
4198
by: Natan | last post by:
When you create and aspx page, this is generated by default: using System; using System.Collections; using System.Collections.Specialized; using System.Configuration; using System.Text; using System.Text.RegularExpressions; using System.Web; using System.Web.Caching;
11
2354
by: Dilip | last post by:
Howdy I have code similar to this in my project: Note: BSTR is an abomination conjured up some disturbed person in the COM world. BSTR strings must be allocated/deallocated using the SysAllocString/SysFreeString Windows APIs. typedef struct tagMyStruct {
3
1247
by: Russ | last post by:
I posted a message on this several days ago, but it apparently got lost in googlespace, so I'll try it again. I recently discovered a bug in my code that apparently resulted from the automatic conversion of a function pointer to an integer. Say you have a class member function called getCount(), which returns an integer. Now suppose you...
3
1860
by: K | last post by:
Hi What software are you using to remove unnecessary white space from your html output? I'm on shared hosting so I don't have the luxury of installing an isapi filter... any tips? tx
0
7839
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8200
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7954
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1448
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1179
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.