Question

I've been implementing areas, but have found that it instantiates a development server for each area when it launches Cassini.

Is this really necessary? MSDN is having me setup these areas as separate web apps, Why can't I put them into class libraries?

Was it helpful?

Solution 2

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top