net deployment and configuration (but mostly about security) jørgen thyme microsoft denmark

21
.NET deployment and configuration (but mostly about security) Jørgen Thyme Microsoft Denmark

Post on 21-Dec-2015

220 views

Category:

Documents


0 download

TRANSCRIPT

.NET deployment and configuration (but mostly about security)

Jørgen ThymeMicrosoft Denmark

AgendaAgenda

What’s an application? What’s an application? Building and PackagingBuilding and Packaging Deploying and AdministeringDeploying and Administering Sharing and CultureSharing and Culture

Common Language RuntimeCommon Language RuntimeApplicationsApplications

One or more assembliesOne or more assemblies Assemblies resolutionAssemblies resolution

Using metadataUsing metadata Local (preferred)Local (preferred) Assembly Global CacheAssembly Global Cache

Different applications may use different Different applications may use different versions of an assemblyversions of an assembly Easier software updatesEasier software updates Easier software removalEasier software removal

Applications overviewApplications overviewA lot of optionsA lot of options

Rich clientRich client Remember .NET Framework distributable!Remember .NET Framework distributable! Traditionel desktopTraditionel desktop Controls (via IE) – no more ActiveXControls (via IE) – no more ActiveX Via (IE) aka No Touch DeploymentVia (IE) aka No Touch Deployment

Thin clientsThin clients Web applicationsWeb applications Web services Web services Mobile web applicationsMobile web applications

PDA’er – compact frameworkPDA’er – compact framework

AgendaAgenda

What’s an application? What’s an application? Building and PackagingBuilding and Packaging Deploying and AdministeringDeploying and Administering Sharing and CultureSharing and Culture

Building and PackagingBuilding and PackagingAssemblies - reviewAssemblies - review

CLR HeaderCLR HeaderCLR HeaderCLR Header

MetadataMetadataMetadataMetadata

MSIL MSIL Managed Managed

codecode

MSIL MSIL Managed Managed

codecode

APP.EXEAPP.EXE

Building and PackagingBuilding and PackagingBuilding Types Into An AssemblyBuilding Types Into An Assembly

RUT.cs method’s compiled RUT.cs method’s compiled MSILMSIL

RUT.cs method’s compiled RUT.cs method’s compiled MSILMSIL

MetadataMetadataRUT.cs defined types, methods…RUT.cs defined types, methods…

RUT.cs referenced types, RUT.cs referenced types, methods…methods…

MetadataMetadataRUT.cs defined types, methods…RUT.cs defined types, methods…

RUT.cs referenced types, RUT.cs referenced types, methods…methods…

RUT.modRUT.mod(using Compiler)(using Compiler)

FUT.cs method’s compiled FUT.cs method’s compiled MSILMSIL

FUT.cs method’s compiled FUT.cs method’s compiled MSILMSIL

MetadataMetadataFUT.cs defined types, methods…FUT.cs defined types, methods…

FUT.cs referenced types, FUT.cs referenced types, methods…methods…

MetadataMetadataFUT.cs defined types, methods…FUT.cs defined types, methods…

FUT.cs referenced types, FUT.cs referenced types, methods…methods…

Types.dllTypes.dll(using Compiler)(using Compiler)

ManifestManifestAssembly files (self & Assembly files (self &

RUT.mod)RUT.mod)Exported types (self & Exported types (self &

RUT.mod)RUT.mod)

ManifestManifestAssembly files (self & Assembly files (self &

RUT.mod)RUT.mod)Exported types (self & Exported types (self &

RUT.mod)RUT.mod)

Building and PackagingBuilding and PackagingBuilding Types Into An AssemblyBuilding Types Into An Assembly

RUT.cs method’s compiled MSILRUT.cs method’s compiled MSILRUT.cs method’s compiled MSILRUT.cs method’s compiled MSIL

MetadataMetadataRUT.cs defined types, methods…RUT.cs defined types, methods…

RUT.cs referenced types, RUT.cs referenced types, methods…methods…

MetadataMetadataRUT.cs defined types, methods…RUT.cs defined types, methods…

RUT.cs referenced types, RUT.cs referenced types, methods…methods…

RUT.mod (using Compiler)RUT.mod (using Compiler)

FUT.cs method’s compiled MSILFUT.cs method’s compiled MSILFUT.cs method’s compiled MSILFUT.cs method’s compiled MSIL

MetadataMetadataFUT.cs defined types, methods…FUT.cs defined types, methods…

FUT.cs referenced types, FUT.cs referenced types, methods…methods…

MetadataMetadataFUT.cs defined types, methods…FUT.cs defined types, methods…

FUT.cs referenced types, FUT.cs referenced types, methods…methods…

FUT.mod (using Compiler)FUT.mod (using Compiler)

(No MSIL)(No MSIL)(No MSIL)(No MSIL)

MetadataMetadataMetadataMetadata

Types.dll (using Assembly Linker)Types.dll (using Assembly Linker)

ManifestManifestAssembly files (FUT.mod & RUT.mod)Assembly files (FUT.mod & RUT.mod)Exported types (FUT.mod & RUT.mod)Exported types (FUT.mod & RUT.mod)

ManifestManifestAssembly files (FUT.mod & RUT.mod)Assembly files (FUT.mod & RUT.mod)Exported types (FUT.mod & RUT.mod)Exported types (FUT.mod & RUT.mod)

AgendaAgenda

What’s an application? What’s an application? Building and PackagingBuilding and Packaging Deploying and AdministeringDeploying and Administering Sharing and CultureSharing and Culture

Deploying and AdministeringDeploying and AdministeringSimple Application DeploymentSimple Application Deployment

Simple Deployment:Simple Deployment: File copy using batch file setupFile copy using batch file setup No modifications to registry or Active No modifications to registry or Active

DirectoryDirectory To uninstall the application, simply delete To uninstall the application, simply delete

all the filesall the files

Other Deployment Methods:Other Deployment Methods: .CAB.CAB .MSI.MSI

Using Configuation FileUsing Configuation File An XML fileAn XML file A file with A file with .exe.config.exe.config extension extension

Deploying and AdministeringDeploying and AdministeringSimple Administrative ControlSimple Administrative Control

AppDir\

{application’s assembly files}

AuxFiles\

{Types’sassembly files}

Deploying and AdministeringDeploying and AdministeringConfiguration FileConfiguration File

<configuration>

<runtime>

<assemblyBinding xmlns=“urn:schemas-microsoft-com:asm-v1”>

<probing privatePath=“AuxFiles” />

</assemblyBinding>

</runtime>

</configuration>

Deploying and AdministeringDeploying and AdministeringSmart Application DeploymentSmart Application Deployment

Smart Deployment:Smart Deployment: ““Return of the Winform!”Return of the Winform!” Still no modifications to registry or Active Still no modifications to registry or Active

DirectoryDirectory Using the webUsing the web ComponentsComponents Windows Forms applications – Windows Forms applications –

”No Touch Install””No Touch Install”

Demonstration Demonstration ”Return of the Win Form” ”Return of the Win Form”

AgendaAgenda

What’s an application? What’s an application? Building and PackagingBuilding and Packaging Deploying and AdministeringDeploying and Administering Sharing and CultureSharing and Culture

Sharing and CultureSharing and CultureShared AssembliesShared Assemblies

What Is It?What Is It? Specifically designed for use by multiple Specifically designed for use by multiple

applicationsapplications Structurally identical to private assembliesStructurally identical to private assemblies Must be placed in a specific location – Must be placed in a specific location –

Global Assembly Cache (GAC)Global Assembly Cache (GAC)

<%WINDIR%>\Assembly<%WINDIR%>\Assembly

Must be registered using AL.EXE or Must be registered using AL.EXE or GACUTIL.EXEGACUTIL.EXE

Sharing and CultureSharing and CultureStrongly Name AssembliesStrongly Name Assemblies

MSILMSILMSILMSIL

MetadataMetadataMetadataMetadata

Calculus.dllCalculus.dll

Public KeyPublic KeyPublic KeyPublic Key

PE FilePE File

ManifestManifestManifestManifest

Public KeyPublic KeyPublic KeyPublic Key

RSA Digital RSA Digital SignatureSignature

RSA Digital RSA Digital SignatureSignature

Hash FileHash FileHash FileHash File RSA Digital RSA Digital SignatureSignature

RSA Digital RSA Digital SignatureSignature

Hash Hash PE FilePE File

Signed with private keySigned with private key

Demonstration Demonstration Shared AssemblyShared Assembly

Shared Assembly PropertiesShared Assembly Properties

Sharing and CultureSharing and CultureVersion NumbersVersion Numbers

What Is Versioning All About?What Is Versioning All About? Runtime only applies version policy to Runtime only applies version policy to

strongly named assembliesstrongly named assemblies Runtime uses whatever private Runtime uses whatever private

assemblies it can find, regardless of its assemblies it can find, regardless of its version informationversion information

ExampleExample22..55..719719..22

majormajor..minorminor..buildbuild..revisionrevision

Sharing and CultureSharing and CultureSide-By-Side ExecutionSide-By-Side Execution

App.exeApp.exe

AssemblyRef 1:AssemblyRef 1: Name: Calculus.dllName: Calculus.dll Version: 1.2.3.4Version: 1.2.3.4 Culture: “”Culture: “” PublicKeyToken: PublicKeyToken: 22acab57c8682eac22acab57c8682eac

AssemblyRef 2:AssemblyRef 2: Name: AdvMath.dll (private Name: AdvMath.dll (private assembly)assembly)

App.exeApp.exe

AssemblyRef 1:AssemblyRef 1: Name: Calculus.dllName: Calculus.dll Version: 1.2.3.4Version: 1.2.3.4 Culture: “”Culture: “” PublicKeyToken: PublicKeyToken: 22acab57c8682eac22acab57c8682eac

AssemblyRef 2:AssemblyRef 2: Name: AdvMath.dll (private Name: AdvMath.dll (private assembly)assembly)

Calculus.dllCalculus.dll

AssemblyDef:AssemblyDef: Version: 1.2.3.4Version: 1.2.3.4 Culture: “”Culture: “” PublicKey: 22acab57c8682eacPublicKey: 22acab57c8682eac

Calculus.dllCalculus.dll

AssemblyDef:AssemblyDef: Version: 1.2.3.4Version: 1.2.3.4 Culture: “”Culture: “” PublicKey: 22acab57c8682eacPublicKey: 22acab57c8682eac

AdvMath.dllAdvMath.dll

AssemblyRef 1:AssemblyRef 1: Name: Calculus.dllName: Calculus.dll Version: 2.0.0.0Version: 2.0.0.0 Culture: “”Culture: “” PublicKeyToken: 03689116d3a4ae33PublicKeyToken: 03689116d3a4ae33

AdvMath.dllAdvMath.dll

AssemblyRef 1:AssemblyRef 1: Name: Calculus.dllName: Calculus.dll Version: 2.0.0.0Version: 2.0.0.0 Culture: “”Culture: “” PublicKeyToken: 03689116d3a4ae33PublicKeyToken: 03689116d3a4ae33

Calculus.dllCalculus.dll

AssemblyDef:AssemblyDef: Version: 2.0.0.0Version: 2.0.0.0 Culture: “”Culture: “” PublicKey: 03689116d3a4ae33PublicKey: 03689116d3a4ae33

Calculus.dllCalculus.dll

AssemblyDef:AssemblyDef: Version: 2.0.0.0Version: 2.0.0.0 Culture: “”Culture: “” PublicKey: 03689116d3a4ae33PublicKey: 03689116d3a4ae33

DiscussionDiscussion