16
Visual Studio 2010 and .NET Framework 4 Training Workshop

Vs2010and Ne Tframework

Embed Size (px)

Citation preview

Page 1: Vs2010and Ne Tframework

Visual Studio 2010and

.NET Framework 4

Training Workshop

Visual Studio 2010and

.NET Framework 4

Training Workshop

Page 2: Vs2010and Ne Tframework

Web Deployment WithVisual Studio 2010

Web Deployment WithVisual Studio 2010

NameTitleOrganizationEmail

Page 3: Vs2010and Ne Tframework

AgendaAgenda

1. Review configuration in ASP.NET and IIS2. Transforming settings in web.config3. Packaging applications for deployment4. Deploying packages to IIS5. Once-click Deployment

Page 4: Vs2010and Ne Tframework

ASP.NET and IIS ConfigurationASP.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 5: Vs2010and Ne Tframework

Review configuration in ASP.NET and IISReview configuration in ASP.NET and IIS

Page 6: Vs2010and Ne Tframework

Web Deployment TodayWeb Deployment Today

Multiple 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 7: Vs2010and Ne Tframework

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

Page 8: Vs2010and Ne Tframework

Managing SettingsManaging Settings

Need 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 9: Vs2010and Ne Tframework

How it Transformation WorksHow it Transformation Works

Web.configWeb.config

Web.Staging.config

Web.Staging.config

Visual StudioTransformationVisual Studio

Transformation

DeployedWeb.config

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 10: Vs2010and Ne Tframework

Web.Config TransformationWeb.Config Transformation

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

node

xdt:Transform=“Remove” Removes the first matched node

xdt:Transform=“RemoveAll” Removes all the matching nodes

xdt: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 11: Vs2010and Ne Tframework

Web.Config Transformation LocatorsWeb.Config Transformation Locators

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

attributes

xdt: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 12: Vs2010and Ne Tframework

MS DeployMS 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 13: Vs2010and Ne Tframework

Integration with Visual Studio 2010Integration with Visual Studio 2010

Page 14: Vs2010and Ne Tframework

One-click DeploymentOne-click Deployment

Leverages everything we’ve seen so farWraps multiple steps into a single click

Page 15: Vs2010and Ne Tframework

Making Deployment EasierMaking Deployment Easier

Page 16: Vs2010and Ne Tframework