473,769 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1627
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******** *************** ***********@mic rosoft.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*****@micros oft.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.co m>
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
3974
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 within my control to change bar_t. Furthermore, I need to be able to update the contained bar_t at runtime (hence the set_bar() method seen below).
35
1254
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 for indexing source code, and for a given function or global variable it can show you all the places where it is referenced. It would be really nice to have a tool that would simply list all of the referenced functions, so that you could go...
24
2821
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 references in the list, there were only those three I need. Many questions come to mind: 1) How do the references make their way into the list? 2) Must the 197 references in A97 that are unused be deleted? Or must they remain in the list.
44
3281
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
4053
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 memory when we use malloc(). Plz help......
2
10918
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( "B.C.D.Print" ); } }
2
267
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 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...
2
6737
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 application, they assume the same namespace and I have no problem passing objects between them. Example: MyNamespace.Webservice_A ws_A = new MyNamespace.Webservice_A(); MyNamespace.WebService_B ws_B = new MyNamespace.WebService_B();...
0
881
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 properties designer.
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10045
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8870
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
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
3
2815
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.