Presenter: PhuongNQK. Goals Provide you insights into core concepts of.NET framework  Assembly  Application domain  MSIL.

Slides:



Advertisements
Similar presentations
.NET Framework Overview
Advertisements

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.
Windows Programming 1 Part 1 dbg --- Getting Acquainted with Visual Studio.NET and C#
.NET Framework Overview Pingping Ma Nov 16 th, 2006.
.NET Technology.
Introduction to the C# Programming Language for the VB Programmer.
.NET deployment and configuration (but mostly about security) Jørgen Thyme Microsoft Denmark.
Keith Elder Microsoft MVP It’s the new wave…man…..
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
1 ClickOnce: Advanced Topics in Web Based Application Deployment for Windows Forms and Avalon Jamie Cool Program Manager Microsoft Corporation Jamie Cool.
.NET framework’s Versions .NET Framework Version Microsoft started development on the.NET Framework in the late 1990s originally under the name of Next.
HELIA – Bite ATK36F © Tuomo Ketomäki.NET Overview.NET Programming.
Intro to dot Net Dr. John Abraham UTPA – Fall 09 CSCI 3327.
Rajeswari Indupuri Introduction to.NET Framework.
Creating and Running Your First C# Program Telerik Software Academy Telerik School Academy.
A Free sample background from © 2001 By Default!Slide 1.NET Overview BY: Pinkesh Desai.
© 2004 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Programming the Web Using ASP.Net Chapter 2: The ASP.Net Template Dave.
Lecture Roger Sutton CO530 Automation Tools 5: Class Libraries and Assemblies 1.
Introduction to .Net Framework
Introduction to Programming
1 Namespaces and Assemblies © University of Linz, Institute for System Software, 2004 published under the Microsoft Curriculum License.
ASP.NET The.NET Framework. The.NET Framework is Microsoft’s distributed run-time environment for creating, deploying, and using applications over the.
1 8/29/05CS360 Windows Programming Professor Shereen Khoja.
Session 1 - Introduction and Data Access Layer
C# A 1 CSC 298 Introduction to C#. C# A 2 What to expect in this class  Background: knowledge of an object oriented language of the C++, Java, … family.
DEV343.NET Application and Library Versioning Juval Löwy
CIS NET Applications1 Chapter 2 –.NET Component- Oriented Programming Essentials.
.NET Framework & C#.
Appendix D: Microsoft.NET Framework Overview. Overview.NET Framework Architecture.NET Namespaces.
Introduction to .NET Framework
Lecture Set 1 Part B: Understanding Visual Studio and.NET – Structure and Terminology 1/16/ :04 PM.
Understanding Code Compilation and Deployment Lesson 4.
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
Importing outside DLLs into.Net platform and using them By Anupama Atmakur.
.NET Framework Overview
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.
C# Overview and Features. Content I.History of C# II.Architecture III.How to install IV.Features V.Code Sample VI.Microsoft.NET Platform VII.Why use C#
Agenda Assemblies 101 Anatomy of an Assembly What is Metadata? Assembly Variations Signing Assemblies Global Assembly Cache.
CS795/895: Introduction. Topics Distributed Systems –Availability –Performance –Web Services Security –Authentication –Authorization –Confidentiality.
.NET Framework Danish Sami UG Lead.NetFoundry
AUC Technologies Projects Consulting, Development, Mentoring, and Training Company Application Foundation Presented By : Naveed Sattar Software Engineer.
tom perkins1 XML Web Services -.NET FRAMEWORK – Part 1 CHAPTER 1.1 – 1.3.
.NetDeploymentNOEA / PQC 2005 Application Deployment and Versioning Source: Joe Hummel, kursus i.Net, jan
Module 1: Getting Started. Introduction to.NET and the.NET Framework Exploring Visual Studio.NET Creating a Windows Application Project Overview Use Visual.
Compunet Corporation1 Programming with Visual Basic.NET Fundamentals of Programming Lecture # 1 Tariq Ibn Aziz.
Intro to dot Net Dr. John Abraham UTPA CSCI 3327.
.NET Ying Chen Junwei Chen. What is Microsoft.NET. NET is a development platform Incorporated into.NET COM+ component services ASP web development framework.
DEV395 No Touch Deployment for Windows Forms Jamie Cool Program Manager.NET Client Microsoft Corporation.
C# and.NET. .NET Architecture  Compiling and running code that targets.NET  Advantages of Microsoft Intermediate Language (MSIL)  Value and Reference.
Module 4: Deployment and Versioning. Overview Introduction to Application Deployment Application Deployment Scenarios Related Topics and Tools.
Bruno Cabral “Reflection, Code Generation and Instrumentation in the.NET platform” University of Coimbra.
July 22, 2001Introduction to.NET1 Introduction to.NET Framework Gholamali Semsarzadeh July 2001.
Text Introduction to.NET Framework. CONFIDENTIAL Agenda .NET Training – Purpose  What is.NET?  Why.NET?  Advantages  Architecture  Components: CLR,
Lecture Set 1 Part B: Understanding Visual Studio and.NET – Structure and Terminology 1/16/ :04 PM.
Assemblies. 2 Objectives Introduce assemblies –concept –creation –naming Discuss deployment –main.exe –dependent assemblies.
METADATA IN.NET Presented By Sukumar Manduva. INTRODUCTION  What is Metadata ? Metadata is a binary information which contains the complete description.
ClickOnce Deployment (One-click Deployment)
Introducing the Microsoft® .NET Framework
An Introduction to the Shared Source Common Language Infrastructure (SSCLI) Damien Watkins Copyright Watkins 2002.
Application Foundation
.NET and .NET Core 2. .NET Runtimes Pan Wuming 2017.
.Net Framework Details Imran Rashid CTO at ManiWeber Technologies.
ClickOnce Deployment (One-click Deployment)
Presentation transcript:

Presenter: PhuongNQK

Goals Provide you insights into core concepts of.NET framework  Assembly  Application domain  MSIL

.NET Framework Overview.NET framework SDK Operating System Visual Studio.NET Common Language Specification (CLS).NET framework redistributable C#VB.NETF#Managed C++ Common Language Runtime (CLR).NET Framework Class Library (FCL) Base Class Library (BCL) ADO.NET, LINQ, XML WCF & WWF (Communication & Workflow) ASP.NETWindows FormsWPF Silverlight Common Type System (CTS) J#…

.NETf libraries

C#, CLR &.NETf versions

What’s new in.NETf 4.0?

What’s new in.NETf 4.5?

.NET core concepts Assembly Application domain MSIL

Assembly Self-describing unit of deployment  Comprise 1 single Windows PE file.exe (application) – defines 1 entry point.dll (reusable library).winmd (WinRT library – contains only metadata)  Contain metadata Container for all types A boundary for type resolution and security permissioning

Assembly content Assembly manifest (info to.NET) – REQUIRED Application manifest (info to OS) Compiled types (IL code + metadata) Resources, e.g. images, localizable text

Assembly manifest The simple name of the assembly A version number (AssemblyVersion) A public key and signed hash of the assembly, if strongly named A list of referenced assemblies, including their version and public key A list of modules that comprise the assembly A list of types defined in the assembly and the module containing each type An optional set of security permissions requested or refused by the assembly (SecurityPermission) The culture it targets, if a satellite assembly (AssemblyCulture) A full title and description (AssemblyTitle and AssemblyDescription) Company and copyright info (AssemblyCompany and AssemblyCopyright) A display version (AssemblyInformationalVersion) Additional attributes for custom data Functional data Informational data AssemblyXXXAttribute classes

Application manifest Read and processed before the.NET-managed hosting environment loads the assembly Can influence how OS launches app’s process Metro applications have a far more elaborate manifest, described in the Pack- age.appxmanifest file. This includes a declaration of the program’s capabilities, which determine permissions granted by OS. Metro applications have a far more elaborate manifest, described in the Pack- age.appxmanifest file. This includes a declaration of the program’s capabilities, which determine permissions granted by OS.

Application manifest How to deploy  As a specially named file located in the same folder as the assembly MyApp.exe -> MyApp.exe.manifest  Embedded within the assembly itself mt -manifest MyApp.exe.manifest -outputresource:MyApp.exe;#1

Assembly types Single file vs. Multi-file Main vs. Satellite Private vs. Shared

Single-file assembly

Multi-file assembly

Main vs. Satellite assemblies

Private assembly Also called weakly-named assembly Usable by a single app An assembly is private by default A private assembly can reference any other assembly

Shared assembly Also called strongly-named assembly Must have  An assembly name  A version  A public key Reside in GAC, hence sharable between apps Multiple versions can co-exist side-by-side A shared assembly can only reference other shared assemblies

How to create a shared assembly? Generate a public/private key pair  sn -k key.snk Use the private key to sign the assembly Install it to GAC ( %Windows%\Microsoft.NET\assembly\ )  gacutil /i

Assembly references Private assembly Shared assembly Private assembly Shared assembly Private assembly Shared assembly Private assembly A references B

A bit on versioning Note: - Default version is incompatible versions have different major and/or minor values - tells CLR to redirect references to a newer version - CLR performs version checking on shared assemblies only Note: - Default version is incompatible versions have different major and/or minor values - tells CLR to redirect references to a newer version - CLR performs version checking on shared assemblies only

Signing assemblies Note: We can delay-sign an assembly.

Assembly identity Simple name  Come from the name of the file to which it was originally compiled (less any extension). E.g. System.Xml.dll -> System.Xml  Not changed when the file is renamed Version (“ ” if not present)  AssemblyVersion Culture (“neutral” if not a satellite)  AssemblyCulture Public key token (“null” if not strongly-named)  Key file

Fully-qualified assembly name simple-name, Version=version, Culture=culture, PublicKeyToken=public-key  System.Xml, Version= , Culture=neutral, PublicKeyToken=b77a5c561934e089

Q & A

.NET core concepts Assembly Application domain MSIL

Application domain The runtime unit of isolation in which a.NET program runs  A managed memory boundary  A container for loaded assemblies and app config settings  A communication boundary for distributed apps Each.NET process usually hosts just 1 app domain: the default domain, auto-created by CLR when the process starts Can create 2+ app domains within the same process  Isolation with less overhead and communication complications (compared to having n processes)  Useful in scenarios such as load testing and app patching, and in implementing robust error recovery mechanisms Win Metro apps can access to only 1 app domain

App domain architecture

Scenario - Problem You’ve written a custom authentication system, and as part of unit testing, you want to stress-test the server code by simulating 20 clients logging in at once. How will you simulate 20 clients?

Scenario - Solutions Start 20 separate processes by calling Process.Start() 20 times Start 20 threads in the same process and domain Start 20 threads in the same process—each in its own app domain

Q & A

.NET core concepts Assembly Application domain MSIL

.NET code lifecycle Managed language code (C#, VB.NET, F#, etc.) Managed language code (C#, VB.NET, F#, etc.) Managed code (MSIL) Managed code (MSIL) Machine code (x86, x64) Machine code (x86, x64).NET compiler CLR-JIT compiler Normal language code (C++, VB, etc.) Normal language code (C++, VB, etc.) Machine code (x86, x64) Machine code (x86, x64) Normal compiler Generated during compile time Generated during runtime

Compiler & Decompiler Managed language code file (.cs,.vb, etc.) Managed language code file (.cs,.vb, etc.) Managed code file (.il) Managed code file (.il) Assembly file (.exe,.dll,.mod) Assembly file (.exe,.dll,.mod) csc, vbc ilasm Dotpeek Reflector ildasm Smart assembly file (.exe,.dll,.mod) Smart assembly file (.exe,.dll,.mod) SmartAssembly

Dynamic assembly Namespace: System.Reflection.Emit Types  AssemblyBuilder  ModuleBuilder  TypeBuilder  ILGenerator  MethodBuilder  DynamicMethod 16/take-two-il-visualizer.aspx 16/take-two-il-visualizer.aspx

Q & A

References C# 5.0 in a Nutshell, by Joseph Albahari & Ben Albahari, O’Reilly Microsoft.Net for Programmers, by Fergal Grimes, Manning

For more, please visit: