Web Application Projects in Team System

While investigating a problem we were having internally with web application solutions in Visual Studio 2005 and Team Build server, I came upon the Web Application Project type for Visual Studio 2005. Wow, wish I found out about this one sooner and it was actually part of Visual Studio 2005! The new built in web application project in Visual Studio 2005 is ok, but it sure has a lot of quirkiness that makes it more troublesome than beneficial in my experience.

After playing around with the new Web Application Project (WAP from now on.. no not that WAP!) for a while, I discovered a couple of tips that might help others out there.

  • In order to get the new WAP support in Visual Studio 2005, you will have to download and install a Visual Studio update and then the new project type:
    - Visual Studio Update
    - Visual Studio 2005 Web Application Projects

  • Creating a new web application project is the same steps as in Visual Studio 2003: you create a new Web Application Project through File > New > Project instead of File > New > Web Site.



  • The WAP type does work with temporary projects, but you will have to close and reopen your project once you save it to a real folder. If you attempt to run your project after saving it to a folder, you will get a couple of nasty error messages:







    Looks like the references aren't updated when you save to a real folder. Smells like a bug to me. ;)

What's nice about having a WAP type is everything works just like VS2003 again. You know exactly where your project settings are saved and you don't have to go through any special menu options. For example, the original way of enabling code analysis for web applications was through the Website menu option. Totally unintuitive. Now with a WAP, it's through the traditional Project Properties dialog. Much better!

Another awkwardness with the original web application type is being forced to checkin files into your source control just because those files are in the same directory as your web app. The WAP type finally fixes this problem since it now knows exactly which files are part of your project and which are not.

Thankfully, the best benefit of VS2005 web application projects carry over to the WAP type in that you don't need to use IIS for debugging. You can still use the webdev server!

So back to the original problem of web applications and Team Build. One of the reasons why we found out about WAP is the explicit support for Team Build. In fact it's the first bullet point!

After messing around with my test project, I found that it indeed does support Team Build, but not out of the box. Issue 6 in the Web Application Project FAQ mentions that the build server needs a copy of the WebApplications build target in order to support the build. Otherwise the build will fail with a

The imported project "H:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\WebApplications\Microsoft.WebApplication.targets" was not found.

error message. Just copy your local C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\WebApplications folder to the build computer (in the same location) which should fix this problem.

What gets built is the single DLL of your web application and also a release build of your entire website in the traditional VS2003 format: ASPX files, DLL files, and any other files you want included. If you would like a VS2005-like web application build (ie. not updatable, precompiled), then you will need to also use the Web Deployment Project.

Here's some other links/resources to read up on to learn more about Web Application Projects in Visual Studio 2005:

posted on Tuesday, August 22, 2006 4:00 PM by ericc

Comments

# Two good posts: Building projects with shared code and using Web Application Projects (WAP)

Last week, the folks at Vertigo Software wrote a couple of really good posts involving Team Build.
The...
Tuesday, August 29, 2006 5:10 AM by Buck Hodges

# ASP.NET 結合 Team Build. 相當重要的議題

我一直認為, 好的軟體架構師 絕對不是 天上飛的那種
否則就是定義上的 模糊... 至少 和我的不一樣...
對於 軟體佈署議題 我一項認為 是非常重要的...
這裡收集的兩分 文件 剛好 點綴出...
Saturday, September 02, 2006 8:56 AM by Refines.Info["Polo Lee"]

# ASP.NET 結合 Team Build. 相當重要的議題

我一直認為, 好的軟體架構師 絕對不是 天上飛的那種
否則就是定義上的 模糊... 至少 和我的不一樣...
對於 軟體佈署議題 我一項認為 是非常重要的...
這裡收集的兩分 文件 剛好 點綴出...
Saturday, September 02, 2006 8:59 AM by Refines.Info["Polo Lee"]

# ASP.NET 結合 Team Build. 相當重要的議題

我一直認為, 好的軟體架構師 絕對不是 天上飛的那種
否則就是定義上的 模糊... 至少 和我的不一樣...
對於 軟體佈署議題 我一項認為 是非常重要的...
這裡收集的兩分 文件 剛好 點綴出...
Saturday, September 02, 2006 8:20 PM by Refines.Info["Polo Lee"]

# Web Application Projects in Team System

Web Application Projects in Team System
Saturday, February 03, 2007 9:05 AM by Bruno C

# re: Web Application Projects in Team System

Huge save on the targets path. Thanks!
Tuesday, February 20, 2007 7:57 PM by Rick