Multi-module Assemblies

You have more than one module and are considering merging it as one assembly. Should you do it?

Avoid multi-module assemblies. In most cases, you can deploy an application as one main EXE plus zero or more DLLs without creating multi-module assemblies.

Compiling multi-module assemblies requires using the Al.exe command-line tool, and this slows down the build process. The main advantage of having a single assembly composed of multiple modules rather than multiple distinct assemblies is that types marked as internal are visible to types in other modules. If you have distinct assemblies, you must mark these types public to make them callable by another assembly. However, in this scenario, you can’t easily prevent other assemblies from using your types. Multi-module assemblies are required when you have to merge modules written in different languages into one assembly. But, in such cases, you should consider splitting the application into distinct assemblies (one per language).

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s