Assemblies. 2 Objectives Introduce assemblies –concept –creation –naming Discuss deployment –main.exe –dependent assemblies.

Slides:



Advertisements
Similar presentations
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.
Advertisements

Building Localized Applications with Microsoft.NET Framework and Visual Studio.NET Achim Ruopp International Program Manager Microsoft Corp.
DESIGNING A PUBLIC KEY INFRASTRUCTURE
Deployment Your Salvation from DLL Hell. Objectives Overview Assemblies „XCopy“ Deployment Configuration Administration.
.NET deployment and configuration (but mostly about security) Jørgen Thyme Microsoft Denmark.
.NET Framework Tools Albrecht Wöß Institute for System Software Johannes Kepler University Linz © University of Linz, Institute for System Software, 2004.
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.
Guide To UNIX Using Linux Third Edition
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.
2. Developing in.NET and C#. 2 Microsoft Objectives “Microsoft.NET development is based on an underlying framework of tools and classes. These tools and.
National Instruments Confidential Deployment Techniques for LabVIEW ™ Applications Kennon Cotton LabVIEW R&D Group Manager.
5 Copyright © 2009, Oracle. All rights reserved. Defining ETL Mappings for Staging Data.
Chapter 3 Navigating a Project Goals & Objectives 1.Get familiar with the navigation of the project. How is everything structured? What settings can you.
February 24 th -25 th 2004 Daragh Byrne – EPCC Additional.NET Concepts.
Lecture Roger Sutton CO530 Automation Tools 5: Class Libraries and Assemblies 1.

.NET Framework Introduction: Metadata
1 Namespaces and Assemblies © University of Linz, Institute for System Software, 2004 published under the Microsoft Curriculum License.
The Metadata System1. 2 Introduction Metadata is data that describes data. Traditionally, metadata has been found in language- specific files (e.g. C/C++
.NET Overview. 2 Objectives Introduce.NET –overview –languages –libraries –development and execution model Examine simple C# program.
Session 1 - Introduction and Data Access Layer
DEV343.NET Application and Library Versioning Juval Löwy
CIS NET Applications1 Chapter 2 –.NET Component- Oriented Programming Essentials.
.NET Framework & C#.
Understanding Code Compilation and Deployment Lesson 4.
Importing outside DLLs into.Net platform and using them By Anupama Atmakur.
C Copyright © 2009, Oracle. All rights reserved. Appendix C: Service-Oriented Architectures.
SUSE Linux Enterprise Server Administration (Course 3037) Chapter 4 Manage Software for SUSE Linux Enterprise Server.
Implementation Yaodong Bi. Introduction to Implementation Purposes of Implementation – Plan the system integrations required in each iteration – Distribute.
Obsydian OLE Automation Ranjit Sahota Chief Architect Obsydian Development Ranjit Sahota Chief Architect Obsydian Development.
Assemblies & Namespaces1. 2 Assemblies (1).NET applications are represented by an assembly An assembly is a collection of all software of which the application.
Presenter: PhuongNQK. Goals Provide you insights into core concepts of.NET framework  Assembly  Application domain  MSIL.
ASSEMBLY. A SSEMBLY Assemblies are the fundamental units of applications in the.net framework An assembly can contain classes, structures, interfaces.
ASSEMBLIES AND THE GAC CHAPTER 1, LESSONS 4-7 & LAB.
Agenda Assemblies 101 Anatomy of an Assembly What is Metadata? Assembly Variations Signing Assemblies Global Assembly Cache.
Configuration Management (CM)
.NET Framework Danish Sami UG Lead.NetFoundry
Module 3: Working with Components. Overview An Introduction to Key.NET Framework Development Technologies Creating a Simple.NET Framework Component Creating.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files.
Java2C# Antonio Cisternino Part V. Outline Assembly & co. Visual Studio environment Example: using DirectX from C#
.NetDeploymentNOEA / PQC 2005 Application Deployment and Versioning Source: Joe Hummel, kursus i.Net, jan
Section 11: Implementing Software Restriction Policies and AppLocker What Is a Software Restriction Policy? Creating a Software Restriction Policy Using.
System.Security.Policy namespace Chinmay Lokesh.NET Security CS 795 Summer 2010.
AUC Technologies Projects Consulting, Development, Mentoring, and Training Company.NET Assemblies Presented By : Muhammad Atif Hussain Deputy Manager IT.
VITALE, CATURANO & COMPANY LTD Microsoft SharePoint Web Part Development Overview VITALE, CATURANO & COMPANY LTD SharePoint Developer Series – Web Part.
Lecture 4: J# Execution Model. 2 MicrosoftIntroducing CS using.NETJ# in Visual Studio.NET 4-2 Objectives “J# programs execute like any other.NET program.
.NET Ying Chen Junwei Chen. What is Microsoft.NET. NET is a development platform Incorporated into.NET COM+ component services ASP web development framework.
J.P. Wellisch, CERN/EP/SFT SCRAM Information on SCRAM J.P. Wellisch, C. Williams, S. Ashby.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Getting Started with.NET Getting Started with.NET/Lesson 1/Slide 1 of 31 Objectives In this lesson, you will learn to: *Identify the components of the.NET.
What is GAC Repository containing all the assemblies of CLR Machine wide Assemblies shared by several applications Where CLR is installed C:\Windows\Microsoft.NET\assembly\GAC_MSIL.
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.
Text Introduction to.NET Framework. CONFIDENTIAL Agenda .NET Training – Purpose  What is.NET?  Why.NET?  Advantages  Architecture  Components: CLR,
Maven. Introduction Using Maven (I) – Installing the Maven plugin for Eclipse – Creating a Maven Project – Building the Project Understanding the POM.
METADATA IN.NET Presented By Sukumar Manduva. INTRODUCTION  What is Metadata ? Metadata is a binary information which contains the complete description.
OE-NIK HP Advanced Programming Using and creating DLL files.
Apache Cocoon – XML Publishing Framework 데이터베이스 연구실 박사 1 학기 이 세영.
ClickOnce Deployment (One-click Deployment)
INF230 Basics in C# Programming
An Introduction to the Shared Source Common Language Infrastructure (SSCLI) Damien Watkins Copyright Watkins 2002.
Chapter 9 S. NandaGopalan, BIT
.NET and .NET Core 2. .NET Runtimes Pan Wuming 2017.
Social Media And Global Computing Using DLLs with MVC
Module 10: Implementing Managed Code in the Database
The Role of Command Line Compiler (csc.exe)
ClickOnce Deployment (One-click Deployment)
Introduction to AppDomains
Presentation transcript:

Assemblies

2 Objectives Introduce assemblies –concept –creation –naming Discuss deployment –main.exe –dependent assemblies

3 Assembly An assembly is a logical group of types –unit of deployment, versioning, and security in the CLR assembly of financial types Advisor Bond Stock Invest

4 Assembly contents Assembly contains several parts –IL –description of contained types in the metadata –description of assembly in the manifest IL.ver publickey... description of Invest, Stock, Bond, Advisor classes code for Invest, Stock, Bond, Advisor classes metadata manifest

5 Type access Two access levels available for types –internal allows access only within same assembly (default) –public allows access from all assemblies available only in assembly internal class Advisor {... } available in all assemblies public class Stock {... }

6 Member access Can make type member internal –allows access only within same assembly available only in assembly public class Stock { internal string name;... }

7 Finance.dll Single file assembly Assembly can be single dll or exe file –simple to create –simple to deploy –most common case Advisor Bond Stock Invest single file assembly

8 source filesassembly Assembly creation Compiler outputs assembly when target type is: –exe –winexe –library compiler Finance.dll Advisor.cs Stock.cs Bond.cs Invest.cs csc /target:library /out:Finance.dll Invest.cs Stock.cs Bond.cs Advisor.cs

9 Module Can create module with compiler /target:module switch –does not create assembly –typically has.netmodule extension Assets.netmodule Stock.cs Bond.cs source filesmodule compiler csc /target:module /out:Assets.netmodule Stock.cs Bond.cs

10 Multi-file assembly Can create multi-file assembly –use /addmodule compiler switch to add module to assembly –can also use more powerful assembly linker al.exe Finance.dll Advisor.cs Invest.cs additional source files two files, one assembly csc /target:library /out:Finance.dll /addmodule:Assets.netmodule Invest.cs Advisor.cs compiler Assets.netmodule

11 Assembly identity Assembly identified by four attributes –name –culture –version –public key token

12 Name Assembly name based on name of file containing manifest –set automatically when assembly created assembly name is Finance compiler Finance.dll csc /target:library /out:Finance.dll...

13 Culture Assembly can specify optional target culture –typical to have separate assembly for each supported culture –assembly will be culture neutral if culture not specified Culture typically specified using AssemblyCulture attribute –in System.Reflection namespace [assembly: AssemblyCulture("fr-CA")] French-Canada

14 Version Assembly can be given a four part version number –major version –minor version –build number –revision Version typically specified using AssemblyVersion attribute –in System.Reflection namespace [assembly: AssemblyVersion(" ")] major.minor.build.revision

15 Public key token Public/private key pair used to give assembly a strong name –used in deployment to provide unique identity –hash of public key called token used since public key is long Procedure: –generate public/private key pair with strong name tool sn.exe –apply to assembly with AssemblyKeyFile attribute –attribute is in System.Reflection namespace sn -k Lib.snk [assembly: AssemblyKeyFile("Lib.snk")] generate keys, specify output file apply keys to assembly

16 Dependent assemblies Typical for application to consist of multiple assemblies –main.exe and supporting.dll s Finance.dll Advisor Bond Stock Invest App.exe Main main.exe supporting.dll

17 Compile time assembly reference Can use type defined in other assembly –must compile with option /r[eference]: Compiler searches for referenced assemblies –current directory –CLR system directory –directories specified by /lib:dir1[,dir2...] switch –directories specified by LIB environment variable App.exeApp.cs csc /target:exe /out:App.exe /reference:Finance.dll App.cs compiler

18 Dependent assembly reference Identity of dependent assemblies recorded in manifest –information used during runtime assembly binding –ensures binding to same assembly at runtime.assembly extern Finance {.publickeytoken....ver }... dependent assembly recorded App.exe

19 Deployment Several actors involved in deployment –main.exe –dependent.dll s –main deployment directory –configuration file

20 AppBase Directory containing main.exe called AppBase C:\ Program Files MyApplication App.exe AppBase

21 Application configuration file Application can have configuration file –used to help manage deployment –file name is application name with.config added –placed in AppBase... App.exe.config file in AppBase directory

22 Deploying dependent assemblies Several options for deployment of dependent assemblies –AppBase –directory below AppBase specified in config file –local or remote location specified by URI in config file –global assembly cache

23 AppBase deployment AppBase automatically searched for needed assemblies C:\ Program Files MyApplication App.exe AppBase Finance.dll dependent assembly

24 Private path Can specify subdirectories of AppBase be searched –use probing privatePath in config file C:\ Program Files MyApplication AppBase MyAssemblies App.exe.config Finance.dll dependent assembly App.exe

25 Codebase Can specify arbitrary URI for strongly named assembly –use codeBase element in config file –useful to redirect to new version of needed assembly C:\ Program Files MyApplication App.exe.config App.exe MyAssemblies Finance.dll not under AppBase dependent assembly

26 Global assembly cache (gac) Strongly named assembly can go in global assembly cache –typically stored under C:\Windows\assembly –need admin privileges to install –automatically searched for needed assemblies –use gacutil tool to manipulate cache Convenient way to store shared assembly –but complicates deployment, backup, and uninstall gacutil /i Finance.dll install gacutil /u Finance,Version= ,PublicKeyToken=362cfdd uninstall

27 Summary Assembly is the component of the CLR –unit of deployment and versioning Assembly identity made of four components –name –culture –version –public key token Application typically made of several assemblies –must reference dependent assemblies at compile time –several options for runtime assembly deployment