Creating and Using Multifile Assemblies
page 2 of 7
by J. Ambrose Little
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 33616/ 61

Why Bother?

At this point, you may be asking yourself (and rightly so), why should I bother with creating a multifile assembly?  My first answer for you is that you probably shouldn't.  In my estimation, the amount of extra work involved does not justify the benefit in most common cases, particularly for ASP.NET development.  However, there some notable exceptions.

For instance, one exception would be if you wanted to create a class library and needed to write it in different languages for whatever reason, such as if you wanted your clients to only have to reference one assembly.  The docs (MSDN) say that this is the most common scenario.

Another good reason would be to optimize downloading an application--you can group types by their usage in the application and thus download them incrementally as you need them.  This is especially poignant for IE-hosted controls (such as using the <object /> tag) because IE will download the assembly manifest first and then create worker threads to download other modules and assemblies.  It is important because IE will be unresponsive while downloading the assembly manifest.

Also, if you wanted multiple developers to write separate sections of the assembly in different projects but did not want to publicly expose some or all types to obtain interoperability between the two, you could declare those types with assembly-level visibility (e.g., internal in C# and Friend in VB.NET).  This particular situation could come up if you needed separate projects because of separate languages (as above) or if you did not have a central code repository and/or no source control but still had multiple developers needing to work independently, or perhaps also if you have two existing projects that you would like to easily merge into one assembly.

As you can see, there are some good reasons for wanting multifile assemblies, but the situations demanding them have thus far been quite rare.  Perhaps once distributed windows forms become more common, they might become more common as well.  So if you find yourself in one of these situations or simply are curious, read on.  I have chosen to demonstrate the multiple language situation because it demonstrates the concepts without overly complicating the example with other issues, such as those related to internet deployment.

 


View Entire Article

User Comments

Title: very good article and explanantion   
Name: Jon
Date: 2005-08-12 12:18:56 AM
Comment:
I don't use Visual Studio for .net development, so this is excellent information for my work.

Thanks
Title: fd   
Name: sp
Date: 2005-07-06 7:08:13 AM
Comment:
good
Title: Good quick explanation of the al   
Name: Tom
Date: 2004-09-28 1:06:37 PM
Comment:
I was looking for a quick explanation of the assembly linker and I found this through a search on the web. It was concise and well written. Thanks.






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-25 4:49:28 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search