.NET and .NET Core 2. .NET Runtimes Pan Wuming 2017.

Slides:



Advertisements
Similar presentations
What is.Net Gary Devendorf. .Net Framework.Net framework works like the Domino Objects only much lower level and very complete It is part of the OS (or.
Advertisements

Ahead of Time Dynamic Translation PreJit/NGEN by any other name George Bosworth Microsoft MRE04 March 21, 2004.
By Sam Nasr September 28, 2004 Understanding MSIL.
Introduction to .NET Framework
.NET Framework Overview
Using.NET Platform Note: Most of the material of these slides have been taken & extended from Nakov’s excellent overview for.NET framework, MSDN and wikipedia.
Building Localized Applications with Microsoft.NET Framework and Visual Studio.NET Achim Ruopp International Program Manager Microsoft Corp.
History of.Net Introduced by Microsoft Earlier technology was VC++ and VB VC++ comes with so many library and VB was so easy to use and not flexible to.
.NET Framework Overview Pingping Ma Nov 16 th, 2006.
.NET Technology.
Overview of the.NET Framework. What is the.NET Framework A new computing platform designed to simplify application development A consistent object-oriented.
.NET deployment and configuration (but mostly about security) Jørgen Thyme Microsoft Denmark.
Introducing the Common Language Runtime for.NET. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution.
Assembly Where it all gets physical. Objectives Introduce concepts of assemblies Discuss elements of assemblies Show how to build assemblies Runtime aspects.
ASP.Net Security: Fundamentals Chapters 1-4 Freeman and Jones Book.
Introducing the Common Language Runtime. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution engine.
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
A Free sample background from © 2001 By Default!Slide 1.NET Overview BY: Pinkesh Desai.
1 Introduction to.NET Framework. 2.NETFramework Internet COM+ Orchestration Orchestration Windows.NET Enterprise ServersBuildingBlockServices Visual Studio.NET.
.NET Framework Introduction: Metadata
Introduction to .Net Framework
Architecture of.NET Framework .NET Framework ٭ Microsoft.NET (pronounced “dot net”) is a software component that runs on the Windows operating.
Session 1 - Introduction and Data Access Layer
11 Getting Started with C# Chapter Objectives You will be able to: 1. Say in general terms how C# differs from C. 2. Create, compile, and run a.
.NET Framework & C#.
 Internet providing backbone for applications  Use of several web sites and devices to provide one complete solution  Software as services  Quick software.
Understanding Code Compilation and Deployment Lesson 4.
ASSEMBLY. A SSEMBLY Assemblies are the fundamental units of applications in the.net framework An assembly can contain classes, structures, interfaces.
Introduction .NET Framework
ASSEMBLIES AND THE GAC CHAPTER 1, LESSONS 4-7 & LAB.
CS795/895: Introduction. Topics Distributed Systems –Availability –Performance –Web Services Security –Authentication –Authorization –Confidentiality.
Managed C++. Objectives Overview to Visual C++.NET Concepts and architecture Developing with Managed Extensions for C++ Use cases Managed C++, Visual.
Component-Based Software Engineering Introduction to.NET Paul Krause.
.NET Framework Danish Sami UG Lead.NetFoundry
tom perkins1 XML Web Services -.NET FRAMEWORK – Part 1 CHAPTER 1.1 – 1.3.
Intro to dot Net Dr. John Abraham UTPA CSCI 3327.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
PRIOR TO WEB SERVICES THE OTHER TECHNOLOGIES ARE:.
.NET Ying Chen Junwei Chen. What is Microsoft.NET. NET is a development platform Incorporated into.NET COM+ component services ASP web development framework.
Microsoft .NET A platform that can be used for building and running windows and web applications such that the software is platform and device-independent.
Common Language Runtime Introduction  The common language runtime is one of the most essential component of the.Net Framework.  It acts.
DEV394.NET Framework: Migrating To Managed Code Adam Nathan QA Lead Richard Lander Program Manager Microsoft Corporation.
Bruno Cabral “Reflection, Code Generation and Instrumentation in the.NET platform” University of Coimbra.
The Execution System1. 2 Introduction Managed code and managed data qualify code or data that executes in cooperation with the execution engine The execution.
Text Introduction to.NET Framework. CONFIDENTIAL Agenda .NET Training – Purpose  What is.NET?  Why.NET?  Advantages  Architecture  Components: CLR,
METADATA IN.NET Presented By Sukumar Manduva. INTRODUCTION  What is Metadata ? Metadata is a binary information which contains the complete description.
Just-In-Time Compilation. Introduction Just-in-time compilation (JIT), also known as dynamic translation, is a method to improve the runtime performance.
Intro to ASP.NET CS-422 Dick Steflik. What is.NET As applications in the Enterprise become more and more netcentric and less and less standalone.NET is.
Introduction to the Microsoft.NET Framework Chris Wastchak Student Ambassador to Microsoft.
ClickOnce Deployment (One-click Deployment)
Lecture 1: The .NET Architecture
.NET Framework.
What is .NET.
Introduction to .NET framework
Introduction to .NET Manuel Costa
An Introduction to the Shared Source Common Language Infrastructure (SSCLI) Damien Watkins Copyright Watkins 2002.
Chapter 9 S. NandaGopalan, BIT
Using The Default CLR Host
.Net A brief introduction to
2.1. Compilers and Interpreters
.NET Framework: Backdoors
Module 1: Getting Started
Introduction to C# AKEEL AHMED.
Programming in C# CHAPTER 1
.NET and .NET Core: Languages, Cloud, Mobile and AI
Module 10: Implementing Managed Code in the Database
.NET Base Type (CTS Data Type) Managed Extensions for C++ Keyword
DOT NET ARCHITECTURE (OR) DOT NET FRAME WORK ARCHITECTURE
ClickOnce Deployment (One-click Deployment)
IS 135 Business Programming
Presentation transcript:

.NET and .NET Core 2. .NET Runtimes Pan Wuming 2017

Copyright © 2012 by Jeffrey Richter

.NET runtimes Common Language Runtime (CLR) for the .NET Framework Core Common Language Runtime (CoreCLR) for .NET Core .NET Native for Universal Windows Platform The Mono runtime for Xamarin.iOS, Xamarin.Android, Xamarin.Mac, and the Mono desktop framework

Topics .NET Application Common Language Runtime (CLR) Assembly: Application Unit Metadata Runtime host Application domains

IL: intermediate language .NET Application A .NET Application contains one or more Assemblies An assembly contains Metadata and IL Code, and resources, within one or many files A .NET Application must run in a host environment The execution of a .NET Application is Managed by CLR IL: intermediate language Self-Host?

Managed execution process Choosing a compiler. Compiling your code to MSIL. Compiling MSIL to native code. Running code. Managed By CLR Create Assembly

Common Language Runtime (CLR)

CLR Services Class Layout Security JIT Compiler Other Runtime Services Type Awareness Exception Integration JIT Compiler Other Runtime Services Class Layout Memory & GC Security

The Roles of CLR Compiler Assembly Development Source code C# VB F# … public static void Main(String[] args ) usr=Environment.GetEnvironmentVariable("USERNAME"); try { { String usr; FileStream f; StreamWriter w; w.WriteLine(usr); w=new StreamWriter(f); f=new FileStream(“C:\\test.txt",FileMode.Create); Console.WriteLine("Exception:"+e.ToString()); } catch (Exception e){ w.Close(); } Compiler public static void Main(String[] args ) usr=Environment.GetEnvironmentVariable("USERNAME"); try { { String usr; FileStream f; StreamWriter w; w.WriteLine(usr); w=new StreamWriter(f); f=new FileStream(“C:\\test.txt",FileMode.Create); Console.WriteLine("Exception:"+e.ToString()); } catch (Exception e){ w.Close(); } Source code C# VB F# … MSIL Metadata Resources

Global Assembly Cache (GAC) Application Directory The Roles of CLR Assembly Development Compiler Assembly Development C# VB F# … MSIL Metadata Resources public static void Main(String[] args ) usr=Environment.GetEnvironmentVariable("USERNAME"); try { { String usr; FileStream f; StreamWriter w; w.WriteLine(usr); w=new StreamWriter(f); f=new FileStream(“C:\\test.txt",FileMode.Create); Console.WriteLine("Exception:"+e.ToString()); } catch (Exception e){ w.Close(); } Source code Global Assembly Cache (GAC) Install Setup Copy Browser Application Directory Download Cache

The Roles of CLR Assembly on Target Machine Development Application Directory Setup Copy Browser Download Cache Deployment Assembly on Target Machine Global Assembly Cache (GAC) Install Policy <security> <mscorlib> <configuration> <?xml version="1.0" encoding="utf-8" ?> <policy> version="1" <CodeGroup class="UnionCodeGroup" <PolicyLevel version="1"> PermissionSetName="Nothing" Description="Code group grants no permissio ns and forms the root of the code group tree."> Name="All_Code" <IMembershipCondition clas s="AllMembershipCondition" version="1"/> PermissionSetName="FullTrust" Execution IL to Native Compiler Class Loader Security Assembly Loader Garbage Collection Native code + GC table Code Manager Exception Manager Thread Support COM Interop Debug Engine

Benefits of Presence of the CLR Performance improvements Cross-language integration Cross-language exception handling Enhanced security Versioning and deployment support A simplified model for component interaction Debugging and profiling services.

Assembly: Application Unit Contains Code Security boundary. Type boundary Reference scope boundary Version boundary Deployment unit To support Side-by-side execution

Manifest Enumerates the files that make up the assembly. Governs how references to the assembly's types and resources map to the files that contain their declarations and implementations. Enumerates other assemblies on which the assembly depends. Provides a level of indirection between consumers of the assembly and the assembly's implementation details. Renders the assembly self-describing.

GAC and Strong-Named Assembly Global Assembly Cache: Machine-wide Code Cache Strongly Named Assemblies Are Tamper-Resistant Strong-Named the simple text name the version number optional culture information a digital signature, and the token of the public key that corresponds to the private key used for signing. Delay Signing or Partial Signing an Assembly Assemblies deployed in the GAC must have a strong name

Signing an assembly

The AssemblyRef metadata information

Metadata within a PE File PE section Contents of PE section PE header The index of the PE file's main sections the address of the entry point. MSIL instructions The Microsoft intermediate language instructions (MSIL) Accompanied by metadata tokens. Metadata Metadata tables and heaps Every type and member Custom attributes Security information. Win32 Portable Executable File Format

Metadata Tables and Heaps Each metadata table holds information about a certain type of elements of your program Method, type, and so on Metadata also stores information in four heap structures String Blob: binary objects of arbitrary size user string GUID: 16-byte binary objects Metadata tokens are used in MSIL to reference a row of a particular metadata table.

Application Domains Application domains are typically created by runtime hosts To provide isolation between assemblies Objects that pass between domains are either copied or accessed by proxy

Runtime Hosts Shell executables IE ASP.NET Before any managed code can be executed, the host must load and initialize the CLR. Loads the runtime into a process Creates the application domains within the process Loads user code into the application domains The hosting APIs All hosts start with an unmanaged stub because the runtime is not yet running in the process. C++! #include <metahost.h> #pragma comment(lib, "mscoree.lib") … hr = CLRCreateInstance(CLSID_CLRMetaHost, IID_ICLRMetaHost, (LPVOID*)&pMetaHost);

Finally, These are the key words: Common Language Runtime (CLR) Assembly Metadata Manifest Global Assembly Cache(GAC) Strong Named Assembly Intermediate language (IL) Delay Sign JIT Complier Garbage collection (GC)