Efficient deployment management of asp net 2 0 applications on iis 6 0
Download
1 / 31

Efficient Deployment Management of ASP 2.0 Applications on IIS 6.0 - PowerPoint PPT Presentation


  • 387 Views
  • Uploaded on

Efficient Deployment & Management of ASP.NET 2.0 Applications on IIS 6.0. Alexis Eller Program Manager Internet Information Services Microsoft Corporation. Agenda. What is ASP.NET? .NET Framework Concepts Global Assembly Cache (GAC) Configuration Layout Code Access Security (CAS)

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Efficient Deployment Management of ASP 2.0 Applications on IIS 6.0 ' - Thomas


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Efficient deployment management of asp net 2 0 applications on iis 6 0 l.jpg

Efficient Deployment & Management of ASP.NET 2.0 Applications on IIS 6.0

Alexis Eller

Program Manager

Internet Information Services

Microsoft Corporation


Agenda l.jpg
Agenda Applications on IIS 6.0

  • What is ASP.NET?

  • .NET Framework Concepts

    • Global Assembly Cache (GAC)

    • Configuration Layout

    • Code Access Security (CAS)

  • Versioning

  • Deployment & Management

  • Running x64 on ASP.NET 2.0 solutions

  • Summary / Q&A


What is asp net l.jpg
What is ASP.NET? Applications on IIS 6.0

  • Part of the .NET Framework

    • IIS 6.0: v2.0, v1.1 in Worker Process Isolation Mode

    • IIS 6.0: v1.0 in IIS 5.0 Compatibility Mode

    • IIS 5.0: only run one version at a time

  • Builds significantly on the power of ASP

  • ASP.NET is “managed” code - the .NET Framework manages memory, not the application (reduces the risk of memory leaks)


Net framework concepts global assembly cache gac l.jpg
.NET Framework Concepts Applications on IIS 6.0Global Assembly Cache (GAC)

  • “Registry” for .NET assemblies

  • Add an assembly to the GAC:

    • Generate a strong name, assembly: 1) name, 2) version, 3) 64 bit public key hash - sn.exe,4) culture

    • Add to the GAC - gacutil.exe, .NET Configuration x.x (MMC Snap-in)

  • Viewing the contents of the GAC:

    • gacutil /l

    • start explorer %windir%\assembly

    • .NET Configuration x.x (MMC Snap-in)

  • Cannot XCOPY deploy GAC’ed assemblies

  • Security: all GAC’ed assemblies (for ASP.NET apps):

    • Run as Full Trust

    • Are accessible to all ASP.NET apps


Adding an assembly to the gac l.jpg

Adding an assembly to the GAC Applications on IIS 6.0


Net framework concepts configuration layout l.jpg
.NET Framework Concepts Applications on IIS 6.0Configuration Layout

Inheritance…

ASP.NET +

.NET Framework

ASP.NET

.NET

Framework

web.config

root web.config

\Windows\Microsoft.NET\Framework\v2.0.50727\config\web.config

machine.config

\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config

web.config files

root configuration files


Net framework concepts code access security cas l.jpg
.NET Framework Concepts Applications on IIS 6.0Code Access Security (CAS)

  • Constrains managed code, including ASP.NET

    • Do you trust your content providers?

    • Do you trust that your applications can’t be exploited?

  • Control access to: file system, registry, printers

  • ASP.NET Trust Levels

    • Full, High, Medium, Low, Minimal (can define custom)

    • Defined by policy files: %windir%\Microsoft.NET\Framework\v2.0.50727\CONFIG\web*trust.config

    • Full trust by default

  • GAC’ed assemblies run as Full trust always


Net framework concepts asp net medium trust l.jpg

Access SQL Server Applications on IIS 6.0

Send e-mail via SMTP

Access certain common environment variables

Access files within the application's directory

Access files outside the application's directory

Use reflection

Use sockets

Access unmanaged code

.NET Framework ConceptsASP.NET Medium Trust

Can...

Cannot...

How to Use Medium Trust in ASP.NET 2.0: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/PAGHT000020.asp



Asp net request processing l.jpg

aspnet_isapi.dll Applications on IIS 6.0

Authentication

Forms

Windows

ASPX

Map Handler

Trace

ASP.NET Request Processing

  • IIS maps request to ASP.NET, forwards to aspnet_isapi.dll

  • ASP.NET ISAPI creates appdomain

Authentication

NTLM

Basic

Anon

Determine

Handler

CGI

Static File

ISAPI

Send Response

Log

Compress


Deployment and management getting started l.jpg
Deployment and Management Applications on IIS 6.0Getting started...

  • Manual:

    • MMC snap-in (in IIS Manager)

    • aspnet_regiis.exe command line tool

    • Edit web.config files using Notepad or Visual Studio

  • Automated:

    • Call aspnet_regiis.exe in a batch file

    • Program against the ASP.NET configuration API (System.Configuration)


Deployment and management aspnet regiis exe l.jpg
Deployment and Management Applications on IIS 6.0aspnet_regiis.exe

  • Provides more functionality than MMC snap-in

    • Enumerate all ASP.NET script map settings

    • Install / uninstall ASP.NET

    • Enable / disable ASP.NET ISAPI extension

  • Unique version in each framework directory:

    C:\Windows\Microsoft.NET\Framework64\v2.0.50727

  • Use in batch files for deployment / management

    • Combine with other utilities to create batch files for deploying applications, content and configurations


Deployment and management aspnet regiis exe 2 l.jpg
Deployment and Management Applications on IIS 6.0aspnet_regiis.exe (2)

  • Combine aspnet_regiis.exe with other utilities for automating deployment

    • Adsutil.vbs to create application pooladsutil.vbs CREATE W3SVC/AppPools/BusyPool "IIsApplicationPool"

    • IISweb.vbs to create the Web site in app pool IISweb.vs /create C:\MySource "MySite" /ap BusyPool /dontstart

    • Aspnet_regiis.exe to install ASP.NET 2.0 change the IIS scriptmap to 2.0C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\apsnet_regiis.exe –enable -ir C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\apsnet_regiis.exe –s W3SVC/<metabase path>


Net framework versioning l.jpg
.NET Framework Versioning Applications on IIS 6.0

  • Can run one version per application pool

  • Each framework version has it’s own version of aspnet_regiis.exe

  • Different IIS scriptmap behavior depending on existing ASP.NET



Deployment and management asp net 2 0 mmc snap in l.jpg
Deployment and Management Applications on IIS 6.0ASP.NET 2.0 MMC Snap-In

  • Overview of the ASP.NET user interface

  • Configuration tabs

  • Understanding the behavior of the MMC snap-in


Deployment and management overview of asp net mmc snap in l.jpg
Deployment and Management Applications on IIS 6.0Overview of ASP.NET MMC Snap-in

  • ASP.NET configuration is:

    • hierarchical and distributed

    • complex enough to warrant a user interface

  • The ASP.NET MMC Snap-in uses Microsoft® Internet Information Services (IIS) Manager’s extensibility


Deployment and management overview of asp net mmc snap in18 l.jpg
Deployment and Management Applications on IIS 6.0Overview of ASP.NET MMC Snap-in

  • Prevents typo’s, incorrect XML tags

  • Manages versioning information

  • Indicates file and virtual path

  • Indicates the date file last modified


Deployment and management configuration tabs l.jpg
Deployment and Management Applications on IIS 6.0Configuration Tabs

  • General

    • Connection strings, Application data

  • Custom Errors

  • Authorization

  • Authentication

    • Authentication settings

    • Membership provider

    • Role Manager provider and enable/disable

  • Application

    • Compilation, Globalization, Identity

  • State Management

    • Session State settings

  • Locations

    • User-defined settings entered as <location> tags in configuration


Deployment and management configuration tab general l.jpg
Deployment and Management Applications on IIS 6.0Configuration Tab - General

  • What can be modified?

    • Database Connections

    • Application Settings

  • Which web.config file is edited? Depends on the object selected in IIS Manager...

    • Server (Web Sites)

    • Web Site

    • Virtual Directory / Folder


Deployment and management configuration tab custom errors l.jpg

What can be modified? Applications on IIS 6.0

Enabling local or remote- only custom errors

Redirect URLs for specific status codes

Default redirect URL

What cannot be modified?

IIS’s custom errors configuration in the metabase

Deployment and ManagementConfiguration Tab – Custom Errors


Deployment and management configuration tab auth n and auth z l.jpg
Deployment and Management Applications on IIS 6.0Configuration Tab – Auth’N and Auth’Z

  • What can be modified?

    • Authentication:

      • Forms vs. Windows

      • Forms authentication settings

      • Membership and Roles providers

    • Authorization Rules: only apply to content handled by the ASP.NET 2.0 ISAPI

  • What cannot be modified?

    • IIS Authentication: Anonymous, Basic, Integrated, etc.

    • IIS does access checks, not authorization rules per URL

    • IIS 6.0 ships with Authorization Manager ISAPI (urlauth.dll) - this is different than ASP.NET authorization


Deployment and management configuration tab application l.jpg
Deployment and Management Applications on IIS 6.0Configuration Tab – Application

  • What can be modified?

    • Compilation and runtime settings

      • Assign a theme to specific page or master page

    • Debugging options

      • Used for development purposes

      • Should be used only in non-production environments (performance considerations)

        • Tip: <deployment retail="true|false" />

    • Globalization options

      • Setting the Code Page, etc.

    • Identity settings

      • Use IIS’s impersonated token -or- override with a specified user identity


Deployment and management configuration tab state management l.jpg
Deployment and Management Applications on IIS 6.0Configuration Tab – State Management

  • What can be modified?

    • Enable ASP.NET Session State Server

    • Enable ASP.NET Session State in SQL Server

    • State management connection strings

  • ASP.NET Session State Server vs. ASP.NET Session State in SQL Server

    • ASP.NET State Server stores state in a process separate from the ASP.NET application

    • ASP.NET Session State in SQL Server stores application\session data in SQL


Deployment and management configuration tab locations l.jpg
Deployment and Management Applications on IIS 6.0Configuration Tab – Locations

  • What can be done with the Locations Tab?

    • Lockdown of features at a granular level

    • Examples:

      • “AllowOverride=false” with a relative path

  • Advanced concept - requires a thorough understanding of configuration

<configuration>

<location path=“Default Web Site/App/Login.aspx” allowOverride=“false”>

<authorization> ...

</location>

<configuration>



Deployment and management understanding the mmc snap in behaviour l.jpg
Deployment and Management Applications on IIS 6.0Understanding the MMC Snap-in Behaviour

  • Multiple configuration editors (such as administrators and developers) can cause errors in the configuration files

    • Configuration errors in the files will cause errors in the user interface

    • User interface cannot read invalid configuration files

    • Updates to web.config files reload the application’s appdomain – loses in process session state, caches, etc.


Running asp net 2 0 on x64 l.jpg
Running ASP.NET 2.0 on x64 Applications on IIS 6.0

  • ASP.NET 1.1 – Requires WOW64

    • 32 bit IIS worker processes on 64 bit OS

    • Virtual memory from 2 GB to 4 GB

    • Enable, from %systemdrive%\Inetpub\AdminScripts, run cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 “true”

  • ASP.NET 2.0 – Runs native 64 bit or WOW64

    • Virtual memory practically unlimited in native 64 bit

  • MMC Snap-in not supported on x64


Summary l.jpg
Summary Applications on IIS 6.0

  • Global Assembly Cache (GAC)

    • All GAC'ed assemblies run in Full trust

    • GAC'ed assemblies cannot be xcopy deployed

  • ASP.NET Trust Levels (CAS Permission Sets)

    • Full trust is not secure enough, Medium is recommended

    • Trust levels can be customized

  • aspnet_regiis.exe: automated deployment and management

  • ASP.NET 2.0 MMC snap-in:

    • provides a safe way to edit configuration

    • writes to hierarchical and distributed web.config

  • ASP.NET v1.1 and v2.0 run side by side on IIS 6.0



Resources l.jpg
Resources Applications on IIS 6.0

  • 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/

  • .NET Blog: When is ReflectionPermission needed?

    • http://blogs.msdn.com/shawnfa/archive/2005/03/08/389768.aspx

  • IIS Webcast Series: [email protected]

    • http://www.iiswebcastseries.com


ad