Tip/Trick: Creating Sub-Web Projects using the VS 2005 Web Application Project Option
One scenario that many large development teams often ask me about is whether it is possible to split up/partition an ASP.NET web application into multiple projects within Visual Studio. The goal with doing this is typically to improve the modularity of large sites and/or to improve the IDE compile-time performance for large projects.
VS 2003 supported splitting up a large site into multiple projects, although it is non-trivial to setup and manage. With the VS 2005 Web Application Project option that we released earlier this spring, it is now pretty easy to set this up and manage it using VS 2005.
Omar Khan (the Group Program Manager for the VS 2005 Web Tools) has published two really great walkthrough posts that describe step-by-step how to setup Sub Web Projects using VS 2005:
-- Creating Sub-Projects in IIS using VS 2005 Web Application Projects: This post describes the basics of how to setup a multi-project solution that builds a single ASP.NET 2.0 application.
-- Creating Shared User Controls and Master Pages with Sub Projects: This post describes how to define master-pages and user controls within a root web project, and the use them within sub-projects in the application.
The above two posts show how to use sub-projects with IIS. Omar's next post in the series will also then cover how to use the same technique with the built-in VS 2005 web-server.
One question I still get asked a lot is what is "the recommended" web project approach to take with VS 2005 -- use the VS 2005 Web Site Project option or the VS 2005 Web Application Project option? The answer is "it depends on your style of working" - there is really no one single recommended way. Some people love the web-site project model option; others think we were nuts and the web application project model option is the only way to go. The reality is that both options are fully supported (meaning you can call up product support and ask for help or hotfixes), both will ship built-in to Visual Studio releases going forward (the web application project option will be included in SP1), and both are perfectly fine options to use depending on your personal preference and application structure. Two articles you might find useful to debate this topic more is this MSDN whitepaper that includes some comparisons between the two models, and Rick Strahl's Web Application Projects and Web Deployment Projects are Here article that also was published in the Code Magazine and which provides a good discussion of the pros/cons of the different options.
Hope this helps,
Scott
P.S. Please visit this page to read more articles in my "ASP.NET 2.0 Tips, Tricks, and Gotchas" series.