+ All Categories
Home > Technology > Web Deployment With Visual Studio 2010

Web Deployment With Visual Studio 2010

Date post: 29-Aug-2014
Category:
Upload: rishu-mehra
View: 3,067 times
Download: 1 times
Share this document with a friend
Description:
Web Deployment With Visual Studio 2010
11
Agenda 1. Transforming settings in web.config 2. Packaging applications for deployment 3. Deploying packages to IIS Name Ravi Pahuja Organization Espire Info Labs Email [email protected]
Transcript
Page 1: Web Deployment With Visual Studio 2010

Agenda1. Transforming settings in web.config2. Packaging applications for deployment3. Deploying packages to IIS

Name Ravi PahujaOrganization Espire Info LabsEmail [email protected]

Page 2: Web Deployment With Visual Studio 2010

ASP.NET and IIS Configuration

Configuration stored in XML files validated by a schema.

Schema describes configuration settings for IIS, ASP.NET and 3rd party applications.

Central configuration file for the server contains system wide configuration settings.

Distributed configuration files contain overrides and local site and application settings.

Validation

Page 3: Web Deployment With Visual Studio 2010

Web Deployment TodayMultiple environments including Development, Testing, Staging and ProductionMust manage settings for each environmentDifficult to keep environments consistentApplications often need to be deployed by someone else

Need to package code, data, application settings and environment configuration for easier deployment

Page 4: Web Deployment With Visual Studio 2010

What are the components, settings, etc you have to deploy with your web application?

Page 5: Web Deployment With Visual Studio 2010

Managing SettingsNeed consistent configuration with customizations across deployment environmentsHaving multiple web.config files introduces inconsistencies

Web.config transformations allows one master web.config with specific customizations for target environments

Page 6: Web Deployment With Visual Studio 2010

How it Transformation Works

Web.config

Web.Staging.config

Visual StudioTransformation

DeployedWeb.config

<appSettings> <add key="EnvironmentName" value="Staging" xdt:Transform="SetAttributes(value)" xdt:Locator="Match(key)" /></appSettings>

<connectionStrings> <add name="LoggingConnectionString" connectionString=“connection" providerName="System.Data.SqlClient" xdt:Transform="Replace" xdt:Locator="Match(name)" /></connectionStrings>

Page 7: Web Deployment With Visual Studio 2010

Web.Config Transformation

Transform Descriptionxdt:Transform=“Replace” Replaces the first matched

nodexdt:Transform=“Remove” Removes the first matched

nodexdt:Transform=“RemoveAll” Removes all the matching

nodesxdt:Transform=“Insert” Inserts the node at the end

xdt:Transform=“SetAttributes(attributeNames)”

Creates or changes values of the existing attributes

xdt:Transform=“RemoveAttributes(attributeNames)”

Removes the attributes if they exist

xdt:Transform=“InsertBefore(XPath)” Inserts the node on the provided Xpath

xdt:Transform=“InsertAfter(XPath)” Inserts the node on the provided XPath

Page 8: Web Deployment With Visual Studio 2010

Web.Config Transformation Locators

Locator Descriptionxdt:Locator=“Match(attributeName)” Can accept comma seperated names of the

attributesxdt:Locator=“Condition(xPath Predicate)” Can take any Xpath predicates like

xdt:Locator="Condition(@name=’Northwind’ or @providerName=’ System.Data.SqlClient’)"

xdt:Locator=“Xpath(/configuration/…)” Can take any complicated Xpath like "XPath(//system.web)"

Page 9: Web Deployment With Visual Studio 2010

MS Deploy

Synchronize, Migrate, DeployWorks with IIS 6.0 and IIS 7.0Analyze the destination environmentDo a –whatif Analysis before committing operation

Includes a service for deploying applications remotelyIntegration

Integrated with PowershellIntegrated in Visual Studio 2010Compatible with Web Platform Installer

Page 10: Web Deployment With Visual Studio 2010

Integration with Visual Studio 2010

Page 11: Web Deployment With Visual Studio 2010

Recommended