Originally Published: 5 July 2003
One of the lesser-talked-about features of .NET is what is commonly referred to as a "multifile assembly." They are often mentioned briefly in passing in articles and books, but few rarely actually demonstrate how to create them and even fewer discuss using them. In this article, we will do both. First, we'll examine some reasons that you might want to use multifile assemblies. Then, we'll cover a few of the options available in creating them, and finally, we'll take a look at how you use them and some of the considerations to keep in mind when deciding whether or not to use them.
In order to demonstrate the concepts involved, I have created a Visual Studio.NET 2003 solution with three projects--VBLibrary, CSLibrary, and Tester. These are, respectively, a small VB.NET class library project containing one .vb file that has one class with one shared method, a small C# class library project containing an AssemblyInfo.cs file, which has assembly metadata attributes, and another .cs file that has a sample cryptography class, and lastly, a small C# console application that is used to demonstrate usage of the multifile assembly produced from the first two projects.