views:

27

answers:

2

I have a large solution which has multiple apps which all share some common site elements (masterpages, navigation, etc).

Currently, all of these get built into a single DLL

If my structure looks like:

WebRoot
 - Common/
 - Shared/
 - Images/
 - App1/
 - App2/
 - etc

Is there a build tool which will allow me to build WebRoot.dll, App1.dll, App2.dll? I don't believe this is possible in VS2008 or the MSBuild tool.

A: 

is there no way that you can move the required 'projects' out of the web root and then make them build separately and then reference then web root with the appropriate projects and thus you can get the .dlls?

PaulStack
Not that I know of. Each of the Apps depends on Common/ so setting up separate projects for each App would result in having duplicates of the common code in each dll, which I believe will result in problems.
chris
A: 

You can do this by using Web Deployment Projects (WDP for VS 2008, WDP for VS 2010). After you download and install that on your web you can right click and select 'Add Web Deployment Project'. Then you can just double click to configure that project. You can configure how the assemblies get generated. The four different options include.

  • Merge all outputs to a single assembly
  • Merge each individual folder output to its own assembly
  • Merge all pages and control outputs to a single assembly
  • Create a separate assembly for each page and control output

Under the covers the WDP is simply invoking the aspnet_compiler.exe as well as aspnet_merge.exe.

Sayed Ibrahim Hashimi
Thanks - I (obviously) didn't know about that.
chris
Hmmm...even when set to Merge each folder into its own assembly, it doesn't - I get one WebRoot.dll, which contains all the classes from the entire project in the WebRoot namespace.
chris