does a references, but unused, namesapce consume resources?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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 said:
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
 
Christian Heide Damm said:
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).
 
Back
Top