













































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!














































Lab version: 1.0.
Last updated: 12/10/
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.
You must have the following items to complete this lab:
Microsoft Visual Studio 2010 IIS 7.
All the requisites for this lab are verified using the Configuration Wizard. To make sure that everything is correctly configured, follow these steps.
Note: To perform the setup steps you need to run the scripts in a command window with administrator privileges.
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.
Note: For each exercise, there is an End folder which contains the resulting solution you should obtain after completing that exercise.
Note: User will perform appropriate name value replacement in all path references containing tag. Note: To verify that each step is correctly performed, it is recommended that you build the solution at the end of each task.
Exercise 1: Using HTML Code Snippets in Visual Studio 2010
Figure 1 Existing Grid View control in Default.aspx
Figure 2 Completion List
Note: The small icons next to each completion indicate what type of completion it is: Indicates that a completion entry is also a snippet keyword
Indicates a snippet keyword Indicates a completion entry
Figure 3 The inserted snippet
**
By selecting the ASP.NET folder and pressing the TAB key, you will see a list of the ASP.NET specific snippets:
You can abort this action by pressing the ESC key. Do not add any more controls to this page at this time.
Task 2 – Creating a Custom HTML Snippet
In this task, you will create a custom HTML snippet for use inside of the Visual Studio 2010 IDE. The new code snippet will create a label control with the preset default values. Any custom Snippets implemented are stored as XML files in a well-known directory.
Figure 5 Snippets list
Figure 6 XML definition of a code snippet list
**
**
This will add a label control with the ID of AddrBlock.
Note: There are two ways to deploy code snippets to the environment. Option1: Save the XML as a .snippet file to the C:\Users\Documents\Visual Studio 10 \Code Snippets\Visual Web Developer\My HTML Snippets\ folder. Visual Studio will automatically find these snippets and make them available for use. Option 2: Save created snippet XML as a .snippet file in some other location and use the Code Snippets Manager to add the snippet to Visual Studio. Snippets added using the Code Snippets Manager will not be available in the auto complete list.
Figure 7 Code Snippets Manager
Figure 9 Snippets folder added to list of snippet locations
Exercise 1: Verification
Exercise 1: Verification
You will verify that you can use the custom HTML snippet from Visual Studio 2010 and that the snippet renders the Label control correctly.
Figure 10 Snippets list with the Snippets folder included
Figure 11 List of snippets in the Snippets folder
Generally a web application goes through a chain of environments before you it makes it into a Production environment. Some of these environments are Development (the developer’s local machine), Quality Assurance (QA), and User Acceptance Testing (UAT)/Staging/Pre-Production. As applications transition through these environments, various settings in the configuration files must change. In addition to database connection strings many Enterprise scale applications also rely on configuration settings for logging destinations, file drop shares and addresses for service endpoints.
Visual Studio 2010 adds a new web.config transformation model that you can use to automate changes to the web.config file during the deployment of the application when you use MSDeploy to promote your code.
Note: To complete the tasks in this exercise, you must have completed all the tasks in Exercise 1, or use the solution from the %TrainingKitInstallFolder%\Labs\WebDevelopment\Source\Ex02- TransformingWebConfig\begin\C#\HTMLLab folder.
Task 1 – Creating a Staging Configuration in Visual Studio 2010
Figure 13 Configuration Manager
Figure 14 New Solution Configuration