chris
chris

Reputation: 37460

Complex ASP.NET web applications and nant

Working on an intranet where we have about 20 different web apps - some .net, some classic asp.

Currently each .net app is its own solution. There are advantages to this - we can build & deploy just one app, without affecting other apps, and all the apps share a session - but we can't use master pages, and there are real challenges using localization resources, shared css and js, etc. Build & deployment is done completely manually, which is a real problem.

I'm trying to set up a structure that will allow us to take advantage of VS2008 features, but still have the ability to update one app without affecting the others while still using features like master pages and localization resources, and sharing session between apps (so we can't set up virtual directories for each app).

If I set up single solution that looks like:

/Root
 - App_GlobalResources/
 - shared
   -- masterpages/
   -- css/
 - App1/
 - App2/
...
 - AppN/
..
 - ClassicASP1/

then the problem is that the build just produces a single DLL (Root.dll) - this will simply not scale to 20+ apps, all of which have different development cycles.

Is it possible (using nant, or some other build tool) to build multiple DLLs? In this case, I'd like to end up with Root.dll (contains the global resources at least) and App1.dll and App2.dll.

Any other suggestions or references I should look at?

Upvotes: 4

Views: 644

Answers (3)

JustEngland
JustEngland

Reputation: 1391

I would advise using MSBuild instead of Nant. It is more native to visual studio.

Upvotes: 0

edosoft
edosoft

Reputation: 17271

There is a solution to this problem. In short, it entails creating a Web Site Project (which can have the masterpage and whatnot) and several subdirectories, each containing a web project. In the main web project you exclude the subdirs from the project. You then add the project files to the solution. This (updated) link tells you all about it.

-Edoode

Upvotes: 0

Nic Wise
Nic Wise

Reputation: 8129

I'm not sure you can do what you want to do, sadly. VS tends to make one DLL per unique project (not solution), and it appears you have just one project, so hence, one DLL.

I'd suggest you keep one project (csproj) per application, but use NANT to build them all (ie, one at a time, together, in order), and package them all up for deployment. That way you can do a single point deployment, but still keep the apps seperate.

I'm surprised you can't use master pages in the sub-folders. You'd need to replicate them for each AppN folder, but again - NANT could be used to pull those in from a common place when you build your deployment package.

Writing a build and deployment script takes a while to get right, but I've found that once it's done, it pays for itself very quickly - even if the only payment is your sanity!

Upvotes: 1

Related Questions