473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

does a references, but unused, namesapce consume resources?

I have a template that I would like to include a namespace in but I won't be using that referenced namespace til a few months from now. In the mean time, will that referenced, but not used/called namespace consume any resources?

The template is going to be used by many people who will modify it to their use now, later when we roll out a new feature which will consume that namespace, they will
1. be set to go if we include the reference to that name space now
2. have to add it to their template for future work
3. have to add it to all their templates and subset scripts written from the template we provided.

The goal here is to create the least amount of work. But I don't want to be consuming any unnecessary resources if I can help it

Thanks for any help on this.

--
KoolistOne and Kurious
Jul 21 '05 #1
2 1587
Is the referenced namespace defined in a separate assembly or in the same
assembly as the template?

If it's in the same assembly, then obviously, the code in the namespace will
be compiled into the assembly and thus take up disk space, but not more than
that.

If it's in a different assembly, and you really don't use anything in the
referenced assembly, then the template assembly won't even contain a
reference to the referenced assembly (open the template assembly with
ildasm.exe, open the manifest, and see that it contains referenced to
System.dll etc. but not unused assembly). Even if you have a using statement
or something to the referenced assembly, it won't consume resources if you
never instantiate any types in it.

Conclusion: it won't consume resources as long as you don't use it.

Christian
"KoolistOne" <Ko********@msn.com(DoNoTsPaM)> wrote in message
news:1C**********************************@microsof t.com...
I have a template that I would like to include a namespace in but I won't be using that referenced namespace til a few months from now. In the mean
time, will that referenced, but not used/called namespace consume any
resources?
The template is going to be used by many people who will modify it to their use now, later when we roll out a new feature which will consume that
namespace, they will 1. be set to go if we include the reference to that name space now
2. have to add it to their template for future work
3. have to add it to all their templates and subset scripts written from the template we provided.
The goal here is to create the least amount of work. But I don't want to be consuming any unnecessary resources if I can help it
Thanks for any help on this.

--
KoolistOne and Kurious

Jul 21 '05 #2
Christian Heide Damm <ch*****@microsoft.com> wrote:
If it's in a different assembly, and you really don't use anything in the
referenced assembly, then the template assembly won't even contain a
reference to the referenced assembly (open the template assembly with
ildasm.exe, open the manifest, and see that it contains referenced to
System.dll etc. but not unused assembly). Even if you have a using statement
or something to the referenced assembly, it won't consume resources if you
never instantiate any types in it.


That depends whether you're using VB.NET or C#. If you use C#, unused
references don't end up in the manifest. If you're using VB.NET, they
do (currently).

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

37
by: Dave | last post by:
Hello all, Please consider the code below. It is representative of a problem I am having. foo_t needs to contain a bar_t which is a class without a copy constructor or operator=. It is not...
35
by: Geronimo W. Christ Esq | last post by:
Are there any scripts or tools out there that could look recursively through a group of C/C++ source files, and allow unreferenced function calls or values to be easily identified ? LXR is handy...
24
by: MLH | last post by:
Most people tell me I only need 3 references. It seems that many of my problems are related to references. I don't know what a reference is, quite frankly. I wish that, instead of about 200...
44
by: Bamber | last post by:
Why does f get returned ? (compiled with gcc). #include<stdio.h> int func(int a); main() { int f; f=func(7); printf("f=%d",f);
74
by: Suyog_Linux | last post by:
I wish to know how the free()function knows how much memory to be freed as we only give pointer to allocated memory as an argument to free(). Does system use an internal variable to store allocated...
2
by: Kyle Blaney | last post by:
Suppose I have the following in file1.cs (all code is compacted to reduce the number of lines): namespace B { namespace C { class D { public static void Print() { System.Console.WriteLine(...
2
by: KoolistOne | last post by:
I have a template that I would like to include a namespace in but I won't be using that referenced namespace til a few months from now. In the mean time, will that referenced, but not used/called...
2
by: MarioPereira | last post by:
I have created a website using .NET Framework 2.0 with some web services that share the same object model (defined in the App_Code). When adding web references to these web services from a web...
0
by: Scott M. | last post by:
In VS 2008 in a Web Application Project, where is the "Removed Unused References" choice that used to be in the project proeprties designer. I no longer have a "References" tab to select in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...

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.