If you’ve been using Web Deployment Projects in Visual Studio 2008 or 2005, you can upgrade to VS 2010 without hesitation now with the availability of Visual Studio 2010 Web Deployment Projects Beta (for Visual Studio Professional and higher skus).
The power tool named “Web Deployment Projects” originally shipped as an out-of-band update for both Visual Studio 2005 and 2008 (for Visual Studio Professional and higher skus). This power tool provided a simplistic way to replace config sections and to integrate the ASP.NET pre-compiler and merge utilities into Visual Studio’s build process. Although Visual Studio 2010 includes a powerful new packaging and deployment technology based on MSDeploy, it is not backward compatible with the previous releases of Web Deployment Projects.
To address this incompatibility we’ve ported the original Web Deployment Projects to VS 2010 and ASP.NET 4.0. With this refresh you’ll now be able to migrate your VS 2008 Web Deployment Projects to VS 2010.
UPDATE: The RTW release of Visual Studio 2010 Web Deployment Projects is now available. See this blog post for details.
Core WDP Features
Visual Studio 2010 Web Deployment Projects preserves all the core functionalities that Visual Studio 2005 Web Deployment Projects and Visual Studio 2008 Web Deployment Projects had… You can read more about this core functionalities in the VS 2005 WDP white paper on MSDN… Also a tutorial on Web Deployment Projects VS 2005 can be found at Scottgu’s blog. Similar to earlier versions of Web Deployment Projects (WDP), you can add a new WDP project using the ‘Add Web Deployment Project …’ item in the context menu of an existing website or web application project (WAP) in your solution (see figure 1).
Figure 1 – Add Web Deployment Project
Migration from WDP for VS 2008 to WDP for VS 2010
When you open a solution containing a WDP project from an earlier version such as VS 2008, you will be presented with the Visual Studio Conversion Wizard. Just following the steps in this Conversion Wizard should have your WDP project migrated to WDP for VS 2010 with all your settings and configurations preserved.
If you already went through the conversion process without installing WDP 2010, conversion would have failed for the WDP project alone and the project will be unloaded in Solution Explorer. Once you install WDP 2010, you can simply re-load the WDP project in Solution Explorer (see figure 2) to bring up the Conversion Wizard and migrate the WDP project to VS 2010.
Figure 2 – Reload WDP project
WDP for VS 2010 Enhancements
Multi-targeting support in WDP 2010
With the release of .NET 4 and the new 4.0 CLR, we now have two versions (2.0 and 4.0) of the compilation and merge tools (aspnet_compiler.exe and aspnet_merge.exe). When you do a “Build” of the Web Deployment Project, Visual Studio ensures that the correct version of these tools are invoked based on the target framework of the website or Web Application Project (WAP), ie. if the website is targeting 2.0 or 3.5, we need to run the 2.0 version of aspnet_compiler.exe and aspnet_merge.exe when we build the WDP and if the website is targeting 4.0, we need to run the 4.0 version.
You can see this in action by setting the MSBuild output verbosity to Normal (default is Minimal) and viewing the contents of the Output window after you do a “Build” of the Web Deployment Project. To set the MSBuild output verbosity, go to Tools > Options > Projects and Solutions > Build and Run, and set the value to ‘Normal’ in the dropdown ‘MSBuild project build output verbosity’.
VS 2010 ensures this by looking at the TargetFrameworkVersion property in the .wdproj file (see figure 3). This property must match the target framework of your website in order for the correct version of the compilation and merge tools to get invoked. When you create a new WDP project for a website/WAP or when you change the target of your website as part of upgrading the solution to VS 2010 or by re-targeting the website through property pages, Visual Studio 2010 automatically handles setting the TargetFrameworkVersion property in the .wdproj file based on the website’s target framework. [Note: With the WDP 2010 Beta, when you change the target of your website as part of upgrade or re-targeting, you may need to save the solution (save-all), close and re-open your solution in order for the TargetFrameworkVersion property to persist correctly in the .wdproj file]
Figure 3 – TargetFrameworkVersion property in the .wdproj file
Packaging in WDP 2010
WDP 2010 now includes an additional ‘Build Deployment Package’ command (see figure 4) that provides some limited functionality to package the WDP output for deployment to an IIS server or web farm using MSDeploy. For WDP 2010 Beta, the ‘Build Deployment Package’ functionality is limited to packaging the Web Content (.aspx, .ascx, images, xml files, PDBs, Binaries etc). For IIS websites/WAPs, you can manually add a property IncludeIisSettings to true in order to package the IIS Settings (Directory browsing, Error pages, Default Documents etc) along with the web content. Example, the .wdproj file will now look like:
Figure 4 – Build Deployment Package command
In a web application project (WAP), the ‘Build Deployment Package’ command also applies any web.config transformations when building the package if you have specified transformation files such as Web.Debug.config and Web.Release.config in your project.
When you run the ‘Build’ command of the WDP, the output typically goes to the Debug folder under the root folder of your WDP project (Example: Website1_deploy\Debug folder if you used the default WDP properties for the Debug configuration). The ‘Build Deployment Package’ command invokes the ‘Build’ command internally, then takes this Website1_deploy\Debug folder as input, packages it, applies any web.config transformations and the output package thus built is placed under Website1_deploy\obj\Debug folder.
You can see this in action by setting the MSBuild output verbosity to Normal as described in the Multi-Targeting support section above.
When to use WDP 2010
Given that Visual Studio 2010 itself includes a powerful new packaging and deployment technology based on MSDeploy, the question may arise when to use the new deployment technology and when to use WDP 2010 for deployment.
In a nutshell, you can use WDP 2010 for:
- Migrating existing solutions with WDP from earlier versions of VS to VS 2010
- Deployment of new or existing website projects using VS 2010
- Deployment of new or existing web application projects (WAPs) using VS 2010 when you need to perform additional pre-compile and merge steps before deployment. If you don’t need to do these additional steps, then you can simply use the MSDeploy-based deployment that’s built in to VS 2010 for deploying a WAP, you don’t need WDP 2010.
We are hoping that WDP for VS 2010 will help you with your deployment needs and make you web development experience better with Visual Studio 2010 … We are eager to hear your feedback and suggestions for improvements hence we are enabling various ways (mentioned below) by which you can share your experiences…
1. MSConnect Feedback System
- Click here to submit feedback via MSConnect…
- Sign in using your Windows Live ID or Microsoft Passport Account…
- On the page, click “Submit Feedback.”…
- Search “Feedback” to see if the issue has already been submitted. If you find an issue similar to your own, you can validate and/or vote on the issue to increase its visibility. Otherwise, continue to the next step…
- Click the “Submit Feedback” button found beneath the search results table…
- You may submit either Bugs or Suggestions by selecting the proper feedback form…
- Make sure that you mention “Visual Studio 2010 Web Deployment Projects” in your Description field…
- Fill in the rest of the form to the best of your ability, and click the “Submit” button…
- We will contact you via your Windows Live ID / Passport email address once we have reviewed your issue…
2. Web Deployment Projects Forum on http://www.asp.net
There is an active community of WDP users on the ASP.Net forums. WDP team also regularly visits the forums so please feel free to go http://forums.asp.net/1020/ShowForum.aspx to share your feedback or ask queries…
3. Blog Comments
We will be monitoring this blog comments also fairly regularly so feel free to provide your feedback and comments here…
4. Email Us
Contact the Web Development Tools team directly by sending mail to vsweb-AT-microsoft-DOT-com, and mention ‘WDP 2010 Beta’ in the subject.
- Visual Web Developer Team