I am very happy to announce that the final release of the VS 2005 Web Application Project is now available. You can download it for free here.
The VS 2005 Web Application Project option provides an alternate web project model option to the VS 2005 Web Site Project Model that ships built-into VS 2005. VS 2005 Web Application Projects support the same project, build and compilation semantics as the VS 2003 web project model. Specifically:
All files contained within the project are defined within a project file (as well as the assembly references and other project meta-data settings). Files under the web’s file-system root that are not defined in the project file are not considered part of the web project.
All code files within the project are compiled into a single assembly that is built and persisted in the \bin directory on each compile. Incremental publishing of compiled apps is fully supported within the IDE (see this post for details).
The compilation system uses a standard MSBuild based compilation process. This can be extended and customized using MSBuild extensibility rules. You can control the build through the property pages, name the output assembly or add pre- and post-build action rules. It can also provide much faster compile times for large web projects.
Because the VS 2005 Web Application Project model has the same conceptual semantics as the VS 2003 Web Project Model, it also makes migrating VS 2003 web projects very, very easy – with zero/minimal code changes required. To learn how to automatically upgrade a VS 2003 web project using this option, please review these VB and C# tutorials that walkthrough the VS 2003 to VS 2005 upgrade process step-by-step.
If you want to migrate an existing VS 2005 Web Site Project to be a VS 2005 Web Application Project, please also review these other VB and C# migration tutorials that walkthrough the Web Site to Web Application conversion process step-by-step. This article here also describes some of the differences between the VS 2005 Web Site Project Model and VS 2005 Web Application Project Model.
Note that the VS 2005 Web Application Project option is available now as a free web download. It will also be added built-in to VS 2005 SP1, and will be fully supported with Visual Studio releases going forward.
New Features with this final VS 2005 Web Application Project Release
Last month I provided an end-to-end walkthrough example that detailed using the VS 2005 Web Application Project (Release Candidate) to build, develop and publish a new ASP.NET application. You can review this walkthrough here.
The main feature additions with the final VS 2005 Web Application Release (above and beyond all the features in the release candidate that you can read about here) include:
Team Build Support with VSTS: You can now perform automated and command-line builds with VS 2005 Web Application Projects and VSTS
Resource support with the App_GlobalResources directory: Strongly typed resource classes are now automatically generated for resource files defined with the ASP.NET app_globalresources directory (allowing you to program against these directly). You can also alternatively define .resx files within the code-behind assembly of the project itself.
Custom Build Tool Action Support: You can now configure and define custom build tool action support for file-types within a project. This was missing in the previous release candidate and prevented some third-party utilities from working.
Edit and Continue Support: You can now make code updates that apply immediately to applications while the debugger is attached and running (see walkthrough below for details). This is supported with both VB and C# projects.
Available as a separate download is a custom build tool for generating a strongly-typed Profile class for the ASP.NET 2.0 Profile system. This allows you to right-click on a web.config file containing profile declarations and auto-generate the Profile type into your code-behind project assembly. You can learn more about this and download it here.
Walkthrough of Edit and Continue Support with VS 2005 Web Application Projects
One feature we added into this final release of the VS 2005 Web Application Project option is “edit and continue” support for both VB and C# web applications. “Edit and Continue” allows developers to modify code while running and debugging an application – without having to stop, recompile and re-launch it. This is true for both code contained within the web project itself as well as for class library projects that the web project references. This enables a much more dynamic coding experience.
The below walkthrough demonstrates how you can easily enable and use “edit and continue” with web application projects.
Step 1: Create a New ASP.NET Web Application Project
Select File->New Project in Visual Studio and choose the “ASP.NET Web Application” template to create a new web project.
Step 2: Add a Button to an ASP.NET Page
Create a new .aspx page within the project. Add a button to the .aspx page, and then double click to create an event handler like so in the code-behind file:
public partial class _Default : System.Web.UI.Page
protected void Button1_Click(object sender, EventArgs e)
Button1.Text = "I was pushed!";
Step 3: Enable Edit and Continue for the Web Application Project
By default edit and continue is not enabled for newly created web application projects. To enable it for a web application project, right-click on the web project in the solution explorer and choose the “Properties” menu item. Select the “web” tab and check the “edit and continue” checkbox:
Note that this checkbox can only be enabled when running the application using the built-in VS 2005 Web Server (this is because VS needs to launch the process – and IIS is a service app that doesn’t currently support this).
Step 4: Launch the App Using F5
Run the application in VS by pressing F5 (Run with Debugging) or by hitting the “Run” button. This will launch the VS 2005 built-in web-server and bring up a browser with a page with the button on it. Push the button to see the message we programmed above.
Step 5: Set and hit a Breakpoint
Switch back to VS -- without stopping debugging or shutting down the browser – and set a breakpoint on the line of code we wrote above (press F9 to-do this). Then within the browser push the button again to break in the debugger at that location:
While stopped within the debugger, I can now add or modify any code within this event handler I want. For example, I could add the following conditional logic to the event handler and modify the Button1.Text statement like so:
And then hit “F5” to continue running the app and immediately see the changes:
There is no need to stop or recompile the application for these types of changes (you’ll notice I was also using FireFox to run the app just for additional fun <g>).
Note that you can also use Edit and Continue support within Class Library projects consumed by a Web Application Project (as well as obviously standalone classes within the project). For example: you could modify the method of a class within a class library project that is being called by an ASP.NET page.
The one constraint of using edit and continue within web projects is that you can’t perform any operations that will cause a restart of the application’s app-domain (for example: modifying the web.config file). Doing so will require you to re-launch the debugger session to see code changes applied. Note that code changes in a class library project or within the web project don’t cause the app-domain to be restarted while running under the debugger – so these types of code changes are just fine.
A page containing known issues for this release of the VS 2005 Web Application Projects can be found here (for example: two features that won’t be added until the SP1 release are support for the new Report Designer Controls and Mobile Web Form Pages). We will also be publishing several additional whitepapers over the next few weeks that go into more details about how to use the VS 2005 Web Application Project option and answer common questions.
This final release of the VS 2005 Web Application Project does require you to install a publicly available patch for VS 2005 before you install the VS 2005 Web Project template support. Unfortunately only the VS English version of the patch is currently available – we are actively working on the non-English SKU editions of VS now (note: you can use the English version of VS on a non-English version of Windows -- that is supported by the patch now). There is a workaround that we discuss in the known-issues/readme link above that you can use if you want to install it immediately (basically you install an English version of VS on your machine to install the patch, and then switch the language back). We will be publishing a blog post about this in the next week or two that provides more details on how to-do this, and then obviously the non-English patches of VS when they are ready in a few weeks time.
As I mentioned earlier, you can also walkthrough other tutorials on the VS 2005 Web Application Project on my web-site here. There is also a dedicated VS 2005 Web Application Project forum that you can use here to post questions or get help (the team actively monitors these forums and is eager to help).
Hope this helps – and thanks for your patience over the last few months,
P.S. If you have a release candidate or beta build of the VS 2005 Web Application Project already installed, you can simple shut-down VS and then uninstall that old version, and then install the final release.