Web Development in Visual Studio 2010

Version: 1.1.0


In this lab, you'll look at several of the new web development features in Visual Studio 2010. You'll see how HTML code snippets speeds up the development of web applications. Visual Studio 2010 also makes it easier to manage multiple Web.config files for the various deployment environments of your web application. Finally, you'll see how Visual Studio 2010 integrates with the Microsoft Web Deployment tool to automate the packaging and deployment of your application and its dependencies.


Microsoft Visual Studio 2010 offers many new features for development of ASP.NET web applications. The goal of these new features is to aid developers in creating and deploying high quality and fully featured web applications quickly and easily.

Visual Studio 2010 now supports HTML code snippets. Snippets are a great way to generate high-quality code. There are many snippets that come with Visual Studio, and developers have the ability to create their own.

Another new feature which Visual Studio 2010 provides is the ability to transform the Web.config file for deployment. Visual Studio 2010 supports a rich configuration transformation language that allows developers to change elements in the Web.config file including connection string, file path locations, and service addresses.

Deployment of ASP.NET web applications is now easier due to new packaging and deployment features in Visual Studio 2010. Now web applications can be easily published to a specific location on the build machine (or even to a ZIP file) and easily deploy to either the Visual Studio Web Server or Windows Internet Information Server (IIS).


In this Hands-On Lab, you will learn how to:

  • Use HTML code snippets to aid in development of ASP.NET web application pages
  • Create and deploy your own custom HTML code snippets
  • Create and automatically transform the Web.config as the web application is deployed across environments
  • Create a deployment package for your ASP.NET web application and deploy the application to either the Visual Studio Development web server or Windows Internet Information Server (IIS)


This Hands-On Lab is comprised by the following exercises:

  • Using HTML Code Snippets in Visual Studio 2010
  • Transforming a Web.config file for deployment
  • Packaging and deploying a web application to the Visual Studio Development Web Server
  • Packaging and deploying a web application to the Windows Internet Information Server (IIS)

Estimated time to complete this lab: 60 minutes.

System Requirements

You must have the following items to complete this lab:

  • Microsoft Visual Studio 2010
  • IIS 7.0


All the requisites for this lab are verified using the Configuration Wizard. To make sure that everything is correctly configured, follow these steps.

  1. Run the Configuration Wizard for the Training Kit if you have not done it previously. To do this, browse to Source\Setup folder of this lab, and double-click the Dependencies.dep file. Install any pre-requisites that are missing (rescanning if necessary) and complete the wizard.

    The Configuration Wizard is used for checking dependencies and setting up the environment. If the Configuration Wizard is not installed on your machine, you must install it running the DependencyChecker.msi file located on the %VS2010TKInstallationFolder%\Assets\DependencyChecker folder (e.g. by default the Training Kit is installed under C:\VS2010TrainingKit).

Starting Materials

This Hands-On Lab includes the following starting materials:

  • Visual Studio solutions: The exercise provides a Visual Studio solution that you can use as starting point for the lab exercise. You will find the starting point at: %TrainingKitInstallFolder%\Labs\WebDevelopment\Source\Ex01-HTMLCodeSnippets\begin\C#\HTMLLab

    • HTMLLab.sln: A solution containing a simple web application used as a starting point for Exercise 1 and the subsequent exercises.

       For each exercise, there is an End folder which contains the resulting solution you should obtain after completing that exercise.

    User will perform appropriate name value replacement in all path references containing <Username> tag.

    To verify that each step is correctly performed, it is recommended that you build the solution at the end of each task.

Next Step

Exercise 1: Using HTML Code Snippets in Visual Studio 2010