So we finally got "areas" in our ASP.NET MVC framework! I'm able to get them up and going but one thing that bothers me is the amount of development servers it instantiates! So I currently have 6 areas, and when I run it I get 6 dev server instances running. Is this really necessary? MSDN is having me setup these areas as seperate web apps, couldn't we get these down into class libraries somehow?
After much research the answer appears to be "not yet". We're still in a preview release of ASP.NET MVC v2 so I've decided I should back off until they feel really good about it.
I thought I'd jot down my experiences for those of you interested in modularizing your ASP.NET MVC projects.
Currently, whenever you do a build it basically copies all of your child projects (created for the areas) into the parent. Which works after a build HOWEVER, once you make a change to your views in an area, the change doesn't show up until you rebuild. This one hurts agility and I know the team is looking at it now.
Because of this "disconnected" project structure, you do get some flagged issues (lost intellisense) in the view which we just typically ignore (like script references etc). Just remember it's one application in the long run.
Also, the issue with that posted above. You will have seperate dev instances when debugging but it deploys as one application.
Overall, there are options to "home grow" your own modularized solution (much like CWAB did) but I'd urge you to wait for the next "supported" preview. I feel really good about this team and their abilities. Perfecting areas will really make us satisfied.
Yes, you can get them down to class libraries. You may want to look into what the guys at MVCContrib are doing. They are calling it portable areas which gives you the libraries that you were asking for. They use their own Embedded view engine to get the views back out of the dll. Here is the link that walks you through the process.
In case anyone stumbles on this because they are still building Areas using multiple projects, you can definitely do this within a single project in MVC 2. With the single-project method, you get only one running instance when you start it up locally. There is an MSDN tutorial that can walk you through single-project Areas, but watch out for their area registration bug when you start unit testing it.