Your official information source from the .NET Web Development and Tools group at Microsoft.
Last week we released ASP.Net MVC 2 Preview 2 for Visual Studio 2008 Sp1. In the box support for single project areas is now included and the Add View tool has been modified to streamline this scenario. A walkthrough that creates two simple single project areas can be found here. If you follow the steps in the walkthrough you will notice that Add Controller and Add View are now available in the single project areas in your ASP.Net MVC 2 Preview 2 application. Here are some screenshots that show off the tooling changes.
Right-Clicking the Controllers folder of any single project area (Areas –> Blog –> Controllers) will invoke the familiar Add Controller dialog.
The new controller will be added to the Controllers folder of the single project area rather than the Controllers folder of the ASP.Net MVC 2 Preview 2 Application.
Right-Click within an action method of the controller to add a view with the Add View dialog.
The view will be added to Areas –> [Area Name] –> Views –> [Controller Name] when added from an action method in the controllers folder of an area. The Views folder structure will be created for you if it does not yet exist. Notice the intellisense error in the view that was added. This is because the area needs a Web.Config just like the Web.Config in the Application’s Views folder. We are working on simplifying some of these scenarios for the next release of ASP.Net MVC 2 but for now you should follow the steps in the walkthrough to register your single project area so that it will work at run time.
Right click within the newly created area to find the familiar Go To Controller context menu item. The controller within your area also contains a Go To View context menu item. You can navigate back and forth between controllers and views in your area just as you can with controllers and views in the root of the ASP.Net MVC 2 application.
Hope this helps you get started with single project areas!
Joe Cartano | Visual Web Developer
I have run the walkthrough sample and it works, but so far I found 2 issues :
On VS2008 running on XP SP2 and MVC 1 installed, default page not shown instead it will display files in root application folder (http://stackoverflow.com/questions/1537757/asp-net-mvc-2-preview-2-display-directory-list-rather-than-home-index)
can we supress the url http://localhost:19735/blog/blog/showrecent
There're 2 blogs there, one for the area and the other is for the controller. I just think it's not 'pretty'
I'll take a look at the first issue you mentioned tomorrow although I have not seen this behavior. As for the second, I think you can configure your routes to enable this, I agree it is not pretty to have a blog/blog/post type url. I'll reply with an example of a more helpful route.