An example of how to create several modules and associate a theme with one dll:
csc /t:module RarelyUsedTypes.cs csc /out:AllTypes.dll /t:library /addmodule:RarelyUsedTypes.netmodule AllTypes.cs
For more information, see Richter's CLR book via C # .
You can automate this process for Visual Studio.
For each of your projects, create a netmodule or assembly and compile / combine them all into one assembly.
The first alternative. This was suggested by Jay R. Wren :
This is a nice hack, but with CSC and VBC that support the /target:module and /addmodule , you could do this without ILMerge using a shell script or make a file.
Visual Studio does not support the "netmodule" type, but MSBuild does.
Add the VB project to your solution. Unload the project and edit the project file.
Change OutputType to module:
<OutputType>module</OutputType>
Instead of adding a link to the desired project, add a module. Unfortunately, again VStudio does not work here, but MSBUILD works fine. Unload the project and edit the project file. Add a group of elements with AddModules include directives.
<ItemGroup><AddModules Include="..\VbXml\bin\Debug\VbXml.netmodule" /></ItemGroup>
This will tell msbuild to tell CSC to use the /addmodule directives, as well as the reference group that Studio controls.
The main disadvantage: there is no Visual Studio Intellisense for the added module. We already have links, it’s too bad that we don’t have modules. [UPDATE: As Arc-kun noted, Visual Studio can link to .netmodule projects and have Intellisense. Just add a link to the project before changing the type of output.]
SharpDevelop has a first step, but a second step - the Add Module GUI has been opened as a low priority item with SD 2.0.
The second alternative. This great article (written by Scott Hanselman) describes how to automatically build assemblies using Visual Studio. It does , gives you IntelliSense support , unlike the first alternative .