what are multi file assemblies good for?

C

cody

What are multi file assemblies good for?
What are the advantages of using multiple assemblies (A.DLL+B.DLL) vs. a
single multi file assembly (A.DLL+A.NETMODULE)?
 
M

Mona

Hi Cody,

Multi-file assemblies are simply assemblies that consist of more than one
file.
Multi-file assemblies are basically used when you want an inter-operability
between different languages,i.e,
maybe some of your programmers only know VB, maybe you need to interop with
some old C/C++ code.
Now you could put each language in its own assembly, but then you get stuck
with a poor organization model.
So,you can have multi-file assemblies where each file may be for a different
language.
You can read up more on this on the following link:
[Multi-file Assemblies]
http://blogs.msdn.com/grantri/archive/2004/07/07/175745.aspx

The biggest advantage of using multi-file assemblies over multiple
assemblies was a more compact organization model.
But,now in the coming version of VB.NET,i.e,Whidbey,you can have a single
file assembly with, VB, C#, C++, and
even native code all in one file! Theoretically you can even link classic
static .LIBs into your brand new C# assembly.
So,multi-file assemblies are on their way out!

HTH

Mona
 
R

Richard Grimes [MVP]

cody said:
What are multi file assemblies good for?
What are the advantages of using multiple assemblies (A.DLL+B.DLL)
vs. a single multi file assembly (A.DLL+A.NETMODULE)?

An assembly is a unit of deployment, type definition and security. A module
is just a module - it takes its security permissions from the assembly, and
it cannot be deployed on its own. Having multiple assemblies means that you
can put code that require few permissions in one and types that require many
permissions in another assembly. (Each assembly can be marked as requiring
certain minimum, permissions). This means that if the code is downloaded,
the assembly (and hence the types within) that require the few permissions
will load, but the assemblies requiring many permissions may not load.

As to an assembly made up of multiple modules, well, take a lesson from
Microsoft - all the framework libraries are single modules.

Richard
 
M

Mattias Sjögren

As to an assembly made up of multiple modules, well, take a lesson from
Microsoft - all the framework libraries are single modules.

Except System.EnterpriseServices



Mattias
 
M

Mattias Sjögren

And what was the reason the splitted it up?

I believe System.EnterpriseServices.dll is written in C# and
System.EnterpriseServices.Thunk.dll
(System.EnterpriseServices.Wrapper.dll in Whidbey) is implemented in
C++. So the reason is more or less what Mona wrote.



Mattias
 
R

Richard Grimes [MVP]

Mattias said:
Except System.EnterpriseServices

There's always one black sheep in the family ;-)

The extra module is the thunk layer used to squeeze COM+ into .NET, so I
regard it as an exception. Of course, if the OP intends to do something
similar then a multi-module file is a good solution, but I reckon not many
developers are likely to have a problem like that. :)

Richard
 

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