SlideShare ist ein Scribd-Unternehmen logo
1 von 15
 An assembly is a fundamental unit of any
.NET application. It contains the code that is
executed by CLR (common language
runtime).
 An assembly contains name, version, types
(classes and others) created in it and details
about other assemblies it references.
 An assembly may be either an executable file
- .EXE or a dynamic link library - .DLL
 The following is the content of an assembly.
Each assembly contains first three parts.
Fourth part may not be present in all
assemblies. It is used primarily for
localization - using resources according to
the country or region.
 Assembly Metadata or Manifest
 Type Metadata
 MSIL Code
 Resources
 This contains information about the
assembly.assemblies in .NET are self-describing. They
contain all the information that .NET needs to use
them. Assembly metadata contains the following
details of an assembly: Assembly name
 Version number of the assembly, which has four
numbers in the format major.minor.revison.build
 Culture - language assembly supports
 Strong name - required only for global assemblies
 List of files in the assembly. An assembly can be
made up of multiple files
 Type reference information - informs which type is in
which file of the assembly
 Information about referenced assemblies -
 This section of an assembly contains
information about all classes, structure etc.
created in the assembly.
 MSIL code of the assembly is placed in third
part of the assembly. This MSIL is converted
to native code by CLR at runtime.
 This section contains messages and pictures
used by assembly.
 Select File->New Project From Templates,
select Class Library .
 Enter name CounterLibrary.
 A class library is created using a single class
Class1 .Rename class to Counter and add the
following code.
 namespace CounterLibrary
 {
 public class Counter
 {
 protected int v = 0;
 public Counter(int v)
 {
 this.v = v;
 }
 public int Value
 {
 get
 {
 return v;
 }
 }
 Save project using File->Save All. When
prompted to enter location for project,
select the folder where you want to save
your project
 Build (not run) the project using Build->Build
Solution
 Start Visual C# 2005 Express Edition
 Create a new console application using File ->
New Project From template select Console
Application as type of project
 Give name UseCounter for application.
A new application is created with a single class
with Main() method.
 Go to Solution Explorer and select project Right
click on it and select Add References from the
context menu. From dialog box, select Browse
tab and select
c:csharpcounterlibrarybinreleasecounterlib
rary.dll Solution explorer displays counterlibrary
as one of the references under references node
in solution explorer
 Add the following code in Main() method of
Program.cs
 static void Main(string[] args)
 {
 CountLibrary.Counter c = new
CountLibrary.Counter(100);
 c.Inc();
 Console.WriteLine(c.Value);
 Console.ReadLine();
 }
 Run and test the application.
 A shared assembly is one that is used by
multiple applications on the machine. A
shared assembly must have a name that is
globally unique.
 The .NET Framework supports these naming
requirements through a technique called
strong names.
 Shared assemblies must have a "strong name"
consisting of the name of the assembly, the
version, a 64 bit hash of a public key (called
a ´token´) and the culture.
 Any assembly that is to be placed in GAC, must have
a strong name. Strong name is a combination of
public key and private key. The relationship
between public and private keys are such, given one
you cannot get the other, but any data that is
encrypted with private key can be decrypted only
with the corresponding public key. Take the following
steps to invoke SN (Strong Name) tool to create
strong name.
 Go to command prompt using Microsoft .NET
Framework SDK v2.0 -> SDK Command prompt
 Go to c:csharpcounterlibrary folder and enter the
following command.
 sn -k srikanth.key The above command writes private
and public key pair into srikanth.key file.

Weitere ähnliche Inhalte

Was ist angesagt?

ppt on scanner class
ppt on scanner classppt on scanner class
ppt on scanner class
deepsxn
 
Byte stream classes.49
Byte stream classes.49Byte stream classes.49
Byte stream classes.49
myrajendra
 

Was ist angesagt? (20)

A08
A08A08
A08
 
Thin Template Explained
Thin Template ExplainedThin Template Explained
Thin Template Explained
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Vb
VbVb
Vb
 
Scanner class
Scanner classScanner class
Scanner class
 
ppt on scanner class
ppt on scanner classppt on scanner class
ppt on scanner class
 
Basic of java
Basic of javaBasic of java
Basic of java
 
Input output files in java
Input output files in javaInput output files in java
Input output files in java
 
Stream
StreamStream
Stream
 
Compilation in c
Compilation in cCompilation in c
Compilation in c
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
 
Handling inputs via scanner class
Handling inputs via scanner classHandling inputs via scanner class
Handling inputs via scanner class
 
Byte stream classes.49
Byte stream classes.49Byte stream classes.49
Byte stream classes.49
 
Linq
LinqLinq
Linq
 
9 Inputs & Outputs
9 Inputs & Outputs9 Inputs & Outputs
9 Inputs & Outputs
 
Preprocessor , IOSTREAM Library,IOMANIP Library
Preprocessor , IOSTREAM Library,IOMANIP LibraryPreprocessor , IOSTREAM Library,IOMANIP Library
Preprocessor , IOSTREAM Library,IOMANIP Library
 
Files in java
Files in javaFiles in java
Files in java
 
Java
JavaJava
Java
 
LINQ
LINQLINQ
LINQ
 
Input output streams
Input output streamsInput output streams
Input output streams
 

Ähnlich wie Assemblies in asp

.NET TECHNOLOGIES
.NET TECHNOLOGIES.NET TECHNOLOGIES
.NET TECHNOLOGIES
Prof Ansari
 
Dotnet interview qa
Dotnet interview qaDotnet interview qa
Dotnet interview qa
abcxyzqaz
 
Talk on .NET assemblies
Talk on .NET assembliesTalk on .NET assemblies
Talk on .NET assemblies
Vidya Agarwal
 
.Net framework interview questions
.Net framework interview questions.Net framework interview questions
.Net framework interview questions
Mir Majid
 

Ähnlich wie Assemblies in asp (20)

THE CLR AND THE .NET FRAMEWORK, C#
THE CLR AND THE .NET FRAMEWORK, C#THE CLR AND THE .NET FRAMEWORK, C#
THE CLR AND THE .NET FRAMEWORK, C#
 
Dot net assembly
Dot net assemblyDot net assembly
Dot net assembly
 
Bt0082 visual basic
Bt0082 visual basicBt0082 visual basic
Bt0082 visual basic
 
C# Unit 1 notes
C# Unit 1 notesC# Unit 1 notes
C# Unit 1 notes
 
C Sharp Jn
C Sharp JnC Sharp Jn
C Sharp Jn
 
C Sharp Jn
C Sharp JnC Sharp Jn
C Sharp Jn
 
Assembly
AssemblyAssembly
Assembly
 
Namespaces in C#
Namespaces in C#Namespaces in C#
Namespaces in C#
 
.NET TECHNOLOGIES
.NET TECHNOLOGIES.NET TECHNOLOGIES
.NET TECHNOLOGIES
 
Object-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modulesObject-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modules
 
2310 b 03
2310 b 032310 b 03
2310 b 03
 
Interview Question of Aspdotnet
Interview Question of AspdotnetInterview Question of Aspdotnet
Interview Question of Aspdotnet
 
Dotnet interview qa
Dotnet interview qaDotnet interview qa
Dotnet interview qa
 
Dotnet basics
Dotnet basicsDotnet basics
Dotnet basics
 
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
 
Net Interview questions
Net Interview questionsNet Interview questions
Net Interview questions
 
Talk on .NET assemblies
Talk on .NET assembliesTalk on .NET assemblies
Talk on .NET assemblies
 
.Net framework interview questions
.Net framework interview questions.Net framework interview questions
.Net framework interview questions
 
Introduction to Visual Studio.NET
Introduction to Visual Studio.NETIntroduction to Visual Studio.NET
Introduction to Visual Studio.NET
 
Intro.net
Intro.netIntro.net
Intro.net
 

Mehr von Er Varun Kumar

Mehr von Er Varun Kumar (6)

PPT made by my group
PPT made by my groupPPT made by my group
PPT made by my group
 
Know your onions
Know your onionsKnow your onions
Know your onions
 
Goldman sachs
Goldman sachsGoldman sachs
Goldman sachs
 
Broadband isdn
Broadband isdnBroadband isdn
Broadband isdn
 
Apple
AppleApple
Apple
 
Oops
OopsOops
Oops
 

Kürzlich hochgeladen

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Kürzlich hochgeladen (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Assemblies in asp

  • 1.
  • 2.  An assembly is a fundamental unit of any .NET application. It contains the code that is executed by CLR (common language runtime).  An assembly contains name, version, types (classes and others) created in it and details about other assemblies it references.  An assembly may be either an executable file - .EXE or a dynamic link library - .DLL
  • 3.  The following is the content of an assembly. Each assembly contains first three parts. Fourth part may not be present in all assemblies. It is used primarily for localization - using resources according to the country or region.  Assembly Metadata or Manifest  Type Metadata  MSIL Code  Resources
  • 4.  This contains information about the assembly.assemblies in .NET are self-describing. They contain all the information that .NET needs to use them. Assembly metadata contains the following details of an assembly: Assembly name  Version number of the assembly, which has four numbers in the format major.minor.revison.build  Culture - language assembly supports  Strong name - required only for global assemblies  List of files in the assembly. An assembly can be made up of multiple files  Type reference information - informs which type is in which file of the assembly  Information about referenced assemblies -
  • 5.  This section of an assembly contains information about all classes, structure etc. created in the assembly.
  • 6.  MSIL code of the assembly is placed in third part of the assembly. This MSIL is converted to native code by CLR at runtime.
  • 7.  This section contains messages and pictures used by assembly.
  • 8.  Select File->New Project From Templates, select Class Library .  Enter name CounterLibrary.  A class library is created using a single class Class1 .Rename class to Counter and add the following code.  namespace CounterLibrary  {  public class Counter  {  protected int v = 0;
  • 9.  public Counter(int v)  {  this.v = v;  }  public int Value  {  get  {  return v;  }  }
  • 10.  Save project using File->Save All. When prompted to enter location for project, select the folder where you want to save your project  Build (not run) the project using Build->Build Solution
  • 11.
  • 12.  Start Visual C# 2005 Express Edition  Create a new console application using File -> New Project From template select Console Application as type of project  Give name UseCounter for application. A new application is created with a single class with Main() method.  Go to Solution Explorer and select project Right click on it and select Add References from the context menu. From dialog box, select Browse tab and select c:csharpcounterlibrarybinreleasecounterlib rary.dll Solution explorer displays counterlibrary as one of the references under references node in solution explorer  Add the following code in Main() method of Program.cs
  • 13.  static void Main(string[] args)  {  CountLibrary.Counter c = new CountLibrary.Counter(100);  c.Inc();  Console.WriteLine(c.Value);  Console.ReadLine();  }  Run and test the application.
  • 14.  A shared assembly is one that is used by multiple applications on the machine. A shared assembly must have a name that is globally unique.  The .NET Framework supports these naming requirements through a technique called strong names.  Shared assemblies must have a "strong name" consisting of the name of the assembly, the version, a 64 bit hash of a public key (called a ´token´) and the culture.
  • 15.  Any assembly that is to be placed in GAC, must have a strong name. Strong name is a combination of public key and private key. The relationship between public and private keys are such, given one you cannot get the other, but any data that is encrypted with private key can be decrypted only with the corresponding public key. Take the following steps to invoke SN (Strong Name) tool to create strong name.  Go to command prompt using Microsoft .NET Framework SDK v2.0 -> SDK Command prompt  Go to c:csharpcounterlibrary folder and enter the following command.  sn -k srikanth.key The above command writes private and public key pair into srikanth.key file.