reference question

Z

z f

Hi,

if i make a DLL with vb/c# dot.net and then reference this DLL from another
application,
is there some global initialization occured on the DLL from only having the
reference or does it use memory and make initialication only when the
referencing app making a new class instance and a function call?

i ask this question because i am having an asp dot-ent web application with
a DLL that have function that i need to call even from cosole apps.
so when i reference an asp-dot net created assembly from a console/windows
app and i make call to function that will work because it does not do
something with the asp framework.
but if the DLL needs some kind of initializations that required, lets say,
running inside IIS or something like that i might have problems in the
future.

if you experienced this or familiar with the internals, please advise.

TIA, z.
 
C

Christopher Kimbell

In my experience, assemblies only get loaded when they are needed. E.g. the
first time a type from the assembly is referenced.

Why do you reference the web app DLL?, why not create a seperate DLL that
can be referenced by both the web app and the console app.

Chris
 
N

Nick Malik

This is going to depend on what you are doing in your DLL.

I strongly recommend that you create a third project within your solution.
Place the common code into the third project.
Write unit tests to test your common code, completely seperate from the
ASP.NET framework. (see NUnit.org)

Now, have both the Web app and the Windows Form app reference the project
that contains the common code.

You shouldn't have any trouble at all.

--- Nick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top