1 / 32

.NET Framework

.NET Framework. Danish Sami UG Lead .NetFoundry http://www.dnfug.com. XML Web Services. Web Forms. ASP.NET. .NET Platform Overview. Windows Forms. C# VB.NET J# C++ …. Data and XML Classes. Base Framework Classes. Common Language Runtime. CLI (The .NET Specifications).

rcone
Download Presentation

.NET Framework

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. .NET Framework Danish Sami UG Lead .NetFoundry http://www.dnfug.com

  2. XML Web Services Web Forms ASP.NET .NET Platform Overview Windows Forms C# VB.NET J# C++ … Data and XML Classes Base Framework Classes Common Language Runtime

  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. Microsoft’s .NET Implementation • CLR – Common Language Runtime • FCL – Framework Class Library BSG Technical Briefing

  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. Overview of CLR Process Process Common Language Runtime App Domain 1 Assembly Assembly Assembly App Domain 3 App Domain 2 Assembly

  7. Overview of CLR Process • 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 • Accesses 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 Assembly/Metadata CLR

  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 Managed Module IL and Metadata Managed Module IL and Metadata Resource File(.jpg, .html, etc.) AssemblyContains 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 Type Members Methods Properties Events

  17. .NET Architecture - Metadata Assembly Manifest Modules 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 • <configSections> • Metadata that tells the framework how to parse the rest of the file • Includes <sectionGroup> and <section> • Individual Section Groups and Sections • <system.web> <system.net> • <appSettings> <authorization> <authentication>

  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. <configSections> • All sections in the config files are specified in <configSections> <section name="appSettings" type="System.Configuration.NameValueFileSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>

More Related