473,322 Members | 1,538 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,322 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 1586
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.