Скачать презентацию Efficient Deployment Management of ASP NET 2 Скачать презентацию Efficient Deployment Management of ASP NET 2

d67075e2508644074b66f5e463fcecbf.ppt

  • Количество слайдов: 33

Efficient Deployment & Management of ASP. NET 2. 0 Applications on IIS 6. 0 Efficient Deployment & Management of ASP. NET 2. 0 Applications on IIS 6. 0 Wade A. Hilmo Development Lead Internet Information Services Microsoft Corporation

Agenda Introduction to ASP. NET Key ASP. NET concepts ASP. NET configuration files Deployment Agenda Introduction to ASP. NET Key ASP. NET concepts ASP. NET configuration files Deployment & Management Versioning Running x 64 on ASP. NET 2. 0 solutions Summary / Q&A

Introduction to ASP. NET is part of the. NET Framework ASP. NET builds significantly Introduction to ASP. NET is part of the. NET Framework ASP. NET builds significantly on the power of dynamic server side programming ASP. NET 2. 0 is the latest release of the framework ASP. NET is “managed” code, meaning that the framework owns the managed memory, not the application

Key ASP. NET concepts GAC vs. private assemblies What is the GAC? Global Assembly Key ASP. NET concepts GAC vs. private assemblies What is the GAC? Global Assembly Cache: This is a pre-defined “registry” that. NET assemblies can reside in and be effectively called by any. NET application Considerations for adding to the Global Assembly Cache (GAC) Fully trusted by ASP. NET applications Accessible by all ASP. NET applications How to add assemblies to the GAC Generating strong names with sn. exe Using gacutil. exe

Adding to the GAC In this demo we generate a strong name and add Adding to the GAC In this demo we generate a strong name and add the assembly to the GAC, then show an application would use it, two separate apps accessing the GAC vs. dropping in their own BIN directory

Key ASP. NET concepts Code Access Security (CAS) What is Code Access Security (CAS)? Key ASP. NET concepts Code Access Security (CAS) What is Code Access Security (CAS)? CAS provides security in a virtual manner in the form of application security EX: / -- security for root application, etc. Trust levels CAS extensibility User code vs. system code

ASP. NET Configuration IIS & ASP. NET Key Config Differences IIS configurations are in ASP. NET Configuration IIS & ASP. NET Key Config Differences IIS configurations are in IIS Metabase, completely different from ASP. NET configs! ASP. NET stores configuration in two files by default: Machine. Config: A global file that is server-wide Exists in %windir%Microsoft. NETFrameworkCONFIG Web. Config: ASP. NET application specific configuration A single file exists that is the “root” web. config, exists in %windir%Microsoft. NETFrameworkCONFIG Additional web. config files can be created at lower levels in the hierarchy (site, vdir, etc. )

ASP. NET Configuration ASP. NET Processing ASP. NET Pipeline The pipeline is the path ASP. NET Configuration ASP. NET Processing ASP. NET Pipeline The pipeline is the path which a request, from beginning to end, follows This pipeline has key points that should be understood to better understand how ASP. NET 2. 0 configuration files affect how the runtime works in the pipeline Processing a ASP. NET Request IIS receives a request Request is authenticated and authorized IIS finds appropriate handler IIS directs request to aspnet_isapi. dll ASP. NET ISAPI creates the App. Domain (if not already running) The manage engine executes the code

Deployment & Management Getting Started… Deploying ASP. NET 2. 0 applications Involves setting initial Deployment & Management Getting Started… Deploying ASP. NET 2. 0 applications Involves setting initial configurations Manually Via command line using aspnet_regiis. exe, Notepad edits to web. config files Via MMC snap-in Automated Programmatically using ASP. NET configuration API Via batch files using aspnet_regiis. exe Managing ASP. NET 2. 0 applications Involves modifying configurations as needed Manually Via command line using Aspnet_regiis. exe Via MMC snap-in Via Web Site Administration Tool Automated via batch files using aspnet_regiis. exe

Deployment & Management Aspnet_regiis. exe command-line utility Manual configuration deployment & management MMC snap-in Deployment & Management Aspnet_regiis. exe command-line utility Manual configuration deployment & management MMC snap-in is safer, but certain actions can only be performed from the command line Automated configuration deployment & management Powerful utility for automating consistent, repeatable actions Can be combined with other utilities to create batch files that deploy applications, content and configurations

Deployment & Management Aspnet_regiis. exe command-line utility (2) A unique version for each version Deployment & Management Aspnet_regiis. exe command-line utility (2) A unique version for each version of ASP. NET Example: C: WINDOWSMicrosoft. NETFramework 64v 2. 0. 50727 would contain the IIS Registration Tool Common Switches -disable/enable To disable or enable ASP. NET in the IIS Security Console. -i Installs the version of ASP. NET that is associated with Aspnet_regiis. exe and updates the script maps at the IIS metabase root and below. Only the script maps for applications that use an earlier version of ASP. NET are updated. Applications that use a later version are not affected. -ir Installs the version of ASP. NET that is associated with Aspnet_regiis. exe, register only, does not update scripts maps in IIS. -r Updates all of the script maps in the IIS metabase and below to point to the ASP. NET ISAPI version that is associated with Aspnet_regiis. exe. All existing script maps are updated to point to the ASP. NET ISAPI version that is associated with the ASP. NET IIS Registration tool, regardless of the current version. -s Install script maps for this version of aspnet_regiis. exe at the specified path, recursively

Deployment & Management Aspnet_regiis. exe command-line utility (3) Combining Aspnet_regiis. exe with other utilities Deployment & Management Aspnet_regiis. exe command-line utility (3) Combining Aspnet_regiis. exe with other utilities for automating deployment Adsutil. vbs to create application pool adsutil. vbs CREATE W 3 SVC/App. Pools/Busy. Pool "IIs. Application. Pool" IISweb. vbs to create the Web site in app pool IISweb. vs /create C: My. Source "My. Site" /ap Busy. Pool /dontstart Aspnet_regiis. exe to install ASP. NET 2. 0 change the IIS scriptmap to 2. 0 C: WINDOWSMicrosoft. NETFrameworkv 2. 0. 50727apsnet_regii s. exe –enable -ir C: WINDOWSMicrosoft. NETFrameworkv 2. 0. 50727apsnet_regii s. exe –s W 3 SVC/

Aspnet_regiis. exe in automation using aspnet_regiis to configure a single application to use ASP. Aspnet_regiis. exe in automation using aspnet_regiis to configure a single application to use ASP. NET 1. 1 and all other applications to use aps. net 2. 0

Deployment & Management ASP. NET 2. 0 user interface (MMC Snap-in) Overview Diving into Deployment & Management ASP. NET 2. 0 user interface (MMC Snap-in) Overview Diving into the ASP. NET user interface Configuration tabs Understanding the behavior of the MMC snap-in

Deployment & Management Overview of MMC Snap-In ASP. NET 2. 0’s configuration is hierarchical Deployment & Management Overview of MMC Snap-In ASP. NET 2. 0’s configuration is hierarchical and distributed The files that build the “run-time” configuration is complex enough to warrant a user interface The ASP. NET user interface snap-in uses Microsoft® Internet Information Services (IIS) Manager’s extensibility

Deployment & Management Overview of MMC Snap-In ASP. NET 2. 0 user interface masks Deployment & Management Overview of MMC Snap-In ASP. NET 2. 0 user interface masks the complexity of the configuration from novice administrators or developers The user interface avoids mistyping or incorrectly locating key XML tags or element information Each tab of the user interface maps to a specific path and file location

Deployment & Management Diving into the ASP. NET user interface ASP. NET Main Interface Deployment & Management Diving into the ASP. NET user interface ASP. NET Main Interface Displays versioning information Indicates file and virtual path Indicates the date file last modified

Deployment & Management Configuration tabs The ASP. NET 2. 0 Snap-in offers the following Deployment & Management Configuration tabs The ASP. NET 2. 0 Snap-in offers the following options: General: Resource Level Configurations and available on all nodes (Server, Site, App) Custom Errors: Used to define specific custom errors actions within the ASP. NET 2. 0 Framework Authorization: Defines the configuration of the Authorization section settings Authentication: Defines the configuration of the Authentication section settings, Membership Providers, and Role Providers Application: Configuration of Connection Strings and App Settings Configuration section State Management: Allows configuration of Session State Section settings Locations: User-defined settings that will be entered as tags in the ASP. NET configuration

Deployment & Management Configuration tab - General What can be modified? Database Connections Application Deployment & Management Configuration tab - General What can be modified? Database Connections Application Settings The file being edited will depend solely on the location in the IIS Manager Server (Web Sites) Site Virtual DirDirectory

Deployment & Management Configuration tab – Custom Errors What can be modified? Enabling Local Deployment & Management Configuration tab – Custom Errors What can be modified? Enabling Local or Remote Only Custom Errors Redirection URLs for Custom Errors Individual Custom Errors What cannot be modified? IIS’s Custom Errors stored in the metabase

Deployment & Management Configuration tabs –Auth. N & Auth. Z What can be modified? Deployment & Management Configuration tabs –Auth. N & Auth. Z What can be modified? ASP. NET can use IIS’s impersonated token -or- override and ignore IIS’s token and use its own Authorization Rules Auth Rules only apply to content that is directed to the ASP. NET 2. 0 ISAPI and does not apply to IIS content What cannot be modified? IIS authentication usage such as Anonymous, Basic, Integrated, etc. IIS can do Access Checks, but not Auth rules based on URL rules IIS 6. 0 ships with Authorization Manager ISAPI (urlauth. dll) but this is different than ASP. NET authorization

Deployment & Management Configuration tab – Application What can be modified? Compile and Run-time Deployment & Management Configuration tab – Application What can be modified? Compile and Run-time settings Assign a theme if desired to page or master Debugging options Only for non-production environments Used for development purposes Globalization options Setting the Code Page, etc. Identity settings

Deployment & Management Configuration tab – State Management What can be modified? Enabling of Deployment & Management Configuration tab – State Management What can be modified? Enabling of the ASP. NET State Machine Enabling of the ASP. NET SQL Server State Connection strings for state management Unique connection strings Comparing ASP. NET State Machine vs. SQL Server State ASP. NET State service stores all state related data in a separate process from ASP. NET application ASP. NET SQL State machine stores applicationsession data in a SQL database

Deployment & Management Configuration tab – Locations What can be done with the Locations Deployment & Management Configuration tab – Locations What can be done with the Locations Tab? Lockdown of features at a granular level Examples: “Allow. Override=false” with a relative path Make specific modifications to configurations for a single or set of files Concept is advanced because it requires a more thorough understanding of the configuration

Configuration Changing configurations using IIS Manager snap-in including setting up a site to use Configuration Changing configurations using IIS Manager snap-in including setting up a site to use forms based authentication and setting a unique configuration on the login. aspx file to use a unique custom error page

Deployment & Management Understanding the MMC snap-in behavior Multiple application editors (such as administrators Deployment & Management Understanding the MMC snap-in behavior Multiple application editors (such as administrators and developers) can cause errors with the configuration files Errors in the actual configuration will cause errors in the user interface cannot read invalid configuration files Be mindful for recylcing actions, anything that updates a web. config file reloads the appdomain and lose any established cache

Deployment & Management Web Site Administration Tool An interface for management without requiring Server Deployment & Management Web Site Administration Tool An interface for management without requiring Server Administrator rights What can be modified: Security tab Manage user accounts, roles, and access rules for the Web site Application tab Application settings name/value Simple Mail Transfer Protocol (SMTP) settings Application status Debugging and tracking Provider tab Manage how ASP. NET stores data

Versioning What is meant by versioning? Versioning is the ability for running simultaneous versions Versioning What is meant by versioning? Versioning is the ability for running simultaneous versions of the framework on the same physical system One version per worker process/app pool Different versions and locations of Aspnet_regiis. exe Different IIS scriptmap behavior depending on existing ASP. NET Initial ASP. NET Configuration ASP. NET not previously installed Scriptmap Behavior Location of Aspnet_regiss. exe IIS Scriptmap defaults to 2. 0 C: WINDOWSMicrosoft. NETFr ameworkv 2. 0. 50727 ASP. NET 1. 1 previously installed Existing scriptmaps unchanged IIS Scriptmap continues to default to 1. 1 C: WINDOWSMicrosoft. NETFr ameworkv 1. 1. 4322 C: WINDOWSMicrosoft. NETFr ameworkv 2. 0. 50727

Running ASP. NET 2. 0 on x 64 IIS 32 bit worker processes on Running ASP. NET 2. 0 on x 64 IIS 32 bit worker processes on 64 bit ASP. NET 1. 1 virtual memory from 2 GB to 4 GB From %systemdrive%InetpubAdmin. Scripts, run cscript. exe adsutil. vbs set W 3 SVC/App. Pools/Enable 32 Bit. App. On. Win 64 “true” Native 64 bit ASP. NET 2. 0 Virtual memory practically unlimited Developers should consider potential performance benefits Known x 64 caveat MMC snap-ion does not work on x 64

Summary Learn to use the GAC App configurations are hierarchal and can be stored Summary Learn to use the GAC App configurations are hierarchal and can be stored in multiple locations ASP. NET_regiis. exe for automated deployment and management of applications ASP. NET 2. 0 MMC snap-in is a GUI for safely editing configurations Multiple versions can run side by side Significant performance benefits for ASP. NET 2. 0 from x 64

References and Resources ASP. NET References and Resources ASP. NET "Whidbey" Documentation Center on MSDN http: //msdn. microsoft. com/asp. net/whidbey/default. aspx ASP. NET user interface http: //msdn. microsoft. com/asp. net/articles/ui/ ASP. NET 2. 0 Fundamentals http: //msdn. microsoft. com/asp. net/articles/fundamentals/ IIS Webcast Series: [email protected] com http: //www. iiswebcastseries. com

Q&A Q&A

© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.