Your official information source from the .NET Web Development and Tools group at Microsoft.
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.
You can download Visual Studio 2010 Web Deployment Projects Beta from the download page (or simply click here to directly download the installer).
UPDATE: The RTW release of Visual Studio 2010 Web Deployment Projects is now available. See this blog post for details.
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
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: <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <IncludeIisSettings>true</IncludeIisSettings>
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.
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:
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
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
With WDP, can it be set up so that the .Net 3.5/4.0 etc. bits (as opposed to the app bits) are also installed from a local location rather than a Microsoft location?
No, WDP does not handle packaging the .NET framework bits such as .NET 3.5/4.0. To do this, you would need something like a Visual Studio Setup project added to your solution.
I'll test those improvements immediately.
i need to download Visual Studio 2010 Web Deployment Projects Beta
Have you received any reports of problems on WDP? When the WDP starts building, it shows on the Output window an indicator that it is working. But some five minutes have passed and it doesn't finish.
This same project had no problems building (quickly) on the 2008 version.
Jesus, sorry that you're running into this. We haven't had this problem reported so far with WDP 2010 Beta. Do you run into this every time you build the WDP or only the first time? If you can email me a zip file of your project to: balach AT microsoft DOT com, we would love to investigate.
Bala Chirtsabesan | Visual Web Developer Team
My build runs with WDP v9.0 including merging of assemblies. When I switch to MSBuild v4 and WDP v10.0 I get the following error:
The specified task executable location "C:\Program Files (x86)\Microsoft\WebDeployment\v10.0\aspnet_merge.exe" is invalid
And indeed there is no such folder. Where does v10.0 install the aspnet_merge.exe file?
Mike, the 3.5 version of the aspnet_merge.exe gets installed in the SDK folder under "Program Files\Microsoft SDKs\Windows\v7.0A\bin". The 4.0 version of the tool gets installed in a sub-folder of this "Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools".
It's unclear why it's looking under the WebDeployment\10.0 folder as mentioned in the error. If you can email me additional details and possibly a zip file of your project that reproduces the issue to: balach AT microsoft DOT com, we would love to investigate.
I installed Visual Web Devloper Express 2010 using the Web Platform Installer. It does not install the Windows SDK. I downloaded the latest SDK installer, which installs to Microsoft SDKs\Windows\v7.0, without the A at the end. I don't know exactly why that is, but at that point I have kind of given up.
If this is not supported maybe it's a good idea to document that for the final release?
The Beta version of Web Deployment Projects 2010 is supported on Visual Studio Professional and higher skus only, this release is currently not available for VWD Express 2010. I have edited the post to clarify this.
Hope this helps,
Deployment packages in VS2010 big deal and it help me :) I am much faster now in deploying ....
项目的 RTW 已经发布了！