What exactly Dll does

  • Thread starter Thread starter nishitha Pothuri
  • Start date Start date
Nishita,

What do you mean? As opposed to an EXE? From .NET 2.0 and on, the only
difference between dlls and exes are that exes are entry points to
applications, dlls are not. You can add references to each of them to use
the types that are used in them.

As for 1.1 and before, you could only set references to DLLs.

Hope this helps.
 
Hi Nicholas,

if I reference an exe in another exe, and then the referencing exe accesses
some type in the referenced exe, what will happen at runtime. Will the
second exe be loaded in the same process as the first, simply as if it were
a dll, or will the exe start its own process.

Christof

Nicholas Paldino said:
Nishita,

What do you mean? As opposed to an EXE? From .NET 2.0 and on, the
only difference between dlls and exes are that exes are entry points to
applications, dlls are not. You can add references to each of them to use
the types that are used in them.

As for 1.1 and before, you could only set references to DLLs.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

 
Christof,

It will not hit the entry point of the referenced EXE. The only code
that is executed is the code that you reference and make explicit calls to.

I have to say that even though this option is available, I think it is a
bad idea to use. You should have shared functionality separated out into
libraries. With an EXE, the possibility exists that the classes exported
from the EXE will depend on conditions/situations that arise from the
running of the EXE.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Christof Nordiek said:
Hi Nicholas,

if I reference an exe in another exe, and then the referencing exe
accesses some type in the referenced exe, what will happen at runtime.
Will the second exe be loaded in the same process as the first, simply as
if it were a dll, or will the exe start its own process.

Christof

Nicholas Paldino said:
Nishita,

What do you mean? As opposed to an EXE? From .NET 2.0 and on, the
only difference between dlls and exes are that exes are entry points to
applications, dlls are not. You can add references to each of them to
use the types that are used in them.

As for 1.1 and before, you could only set references to DLLs.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

 
Nicholas Paldino said:
It will not hit the entry point of the referenced EXE. The only code
that is executed is the code that you reference and make explicit calls to.

I have to say that even though this option is available, I think it is a
bad idea to use. You should have shared functionality separated out into
libraries. With an EXE, the possibility exists that the classes exported
from the EXE will depend on conditions/situations that arise from the
running of the EXE.

I don't know - it's very handy for a DLL to reference an EXE in some
situations. For instance, suppose I write a little tool which allows
plugins to be written. If there's no real need to write the plugin
interface in its own assembly, it's simpler just to have the one EXE
file which the DLLs it loads can reference to implement the interface.

Likewise a unit test class library may want to reference an EXE file
that contains the types it's testing.
 
Nicholas said:
What do you mean? As opposed to an EXE? From .NET 2.0 and on, the only
difference between dlls and exes are that exes are entry points to
applications, dlls are not. You can add references to each of them to use
the types that are used in them.

As for 1.1 and before, you could only set references to DLLs.

No.

You can reference an EXE just fine in .NET 1.1 !

Visual Studio 2003 has a check that does not allow it,
but the C# compiler does not have any problems with it.

Arne
 
As a matter of face, you can rename an .EXE to have a .DLL extension and it
will still work (by being referenced) just fine.
 

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

Back
Top