Download presentation
Presentation is loading. Please wait.
1
.NET Framework Danish Sami UG Lead.NetFoundry http://www.dnfug.com
2
Common Language Runtime Base Framework Classes Data and XML Classes C# VB.NET J# C++ … XML Web ServicesWebForms ASP.NET WindowsForms.NET Platform Overview
3
CLI (The.NET Specifications) Common Language Infrastructure A common type system The specification that determines how the runtime defines, uses, and manages types Execution Engine Architecture (runtime) A common Intermediate Language format A small set of base classes A Standard (ECMA-335)
4
10/11/2015BSG Technical Briefing 4 Microsoft’s.NET Implementation CLR – Common Language Runtime FCL – Framework Class Library
5
Overview of CLR Code management (loading and execution) Application memory isolation Verification of type safety Conversion of IL to native code Access to metadata (enhanced type information) Managing memory for managed objects Enforcement of code access security Exception handling, including cross-language exceptions Interoperation between managed code, COM objects, and pre-existing DLLs (unmanaged code and data) Automation of object layout Support for developer services (profiling, debugging, and so on)
6
Process Common Language Runtime App Domain 1 App Domain 2 App Domain 3 Assembly Overview of CLR Process
7
CLR verifies the type safety of an assembly when it is loaded, assuring that isolation between app domains is enforced Security Policy is enforced based on characteristics of the assembly (evidence)
8
SideBar - Some Key Terminology Type Value Types (Int32, String, DateTime, etc) Reference Types (Classes Arrays, Interfaces, Pointers, Enumerations) Managed Code Code that runs through the CLR Type Safe Code A ccesses types only in well-defined, allowable ways and doesn’t access memory directly
9
.NET Building Blocks Assemblies Modules
10
Source to Executable Source Code Compiler Module/Metadata/IL CLR Assembly/Metadata
11
Modules Source code is compiled to.dll (a library) or.exe (an executable)
12
Assemblies A bundle of One or more modules Zero or more Resource files A Manifest Can be strong-named (signed with a key)
13
Assemblies One or more files containing type definitions and resource files Managed Module IL and Metadata Resource File (.jpg,.html, etc.) Assembly Contains Manifest of files
14
Manifest File Establishes the assembly identity (in the form of a text name), version, culture, and digital signature (if the assembly is to be shared across applications). Defines what files (by name and file hash) make up the assembly implementation. Specifies the types and resources that make up the assembly, including which are exported from the assembly. Itemizes the compile-time dependencies on other assemblies. Specifies the set of permissions required for the assembly to run properly.
15
Module/Assembly Note that many times, an assembly you create may contain just one module This is the default in a VS.NET project
16
Hierarchy Assembly Modules Types Attributes Constructors Fields Methods Properties Events Type Members
17
.NET Architecture - Metadata Assembly Modules Manifest Types, Members, References
18
Reflection System.Reflection Namespace Uses Viewing Metadata Type Discovery Dynamic Binding
19
Strong-Named Assemblies An digitally signed assembly Strong integrity check Full Name: System.data, version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
20
Steps to Sign an Assembly sn.exe –k SampleKey.snk Entry in AssemblyInfo.cs Build
21
Location of Assemblies The application's directory or subdirectories. (Easy XCopy deployment) Global Assembly Cache (Requires a setup package) Assemblies must be strong-named
22
Global Assembly Cache Shared assemblies Side by side versioning Control of versions using policy files Caching of downloadable assemblies Requires a “strong-named” assembly
23
Adding an Assembly to the Cache Build a strong-named assembly Drag and Drop into c:\windows\assembly Or Gacutil -i
24
Policy Files An xml file specifying assembly binding information Control version of assembly that is used by programs regardless of what version they were built with
25
Deploying a Policy File Create the xml file Use the assembly linker to include it in an assembly Install in into the GAC
26
Assembly Binding Behavior in config files Can be configured at different levels based on three XML files: Application configuration file. Publisher policy file. Machine configuration file.
27
Assemblies (the new Components) Think of and assembly as a component along the lines of a COM Component It is the unit of versioning, deployment, security, etc. You may want to break apps into multiple “components”
28
Garbage Collection The CLR takes care of disposing of unreferenced objects
29
.NET Configuration Files web.config app.exe.config machine.config
30
Config File Structure Two main parts Metadata that tells the framework how to parse the rest of the file Includes and Individual Section Groups and Sections
31
machine.config machine.config affects all.NET apps C:\WINDOWS\Microsoft.NET\Framework\version\CONFIG\ web.config and app.exe.config files inherit the machine.config master settings Sections in our app config files can override the inherited settings.
32
All sections in the config files are specified in
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.