SlideShare a Scribd company logo
1 of 19
.NET Tutorial
Assemblies
www.sirykt.blogspot.com
• Reusable concepts in c#.net:
• c#.net supports 2 types of reusable concepts
• 1.class Library(namespace)
• 2.windows forms control library(control)
• 1.Class library:
• It is the collection of namespaces. every namespace one dll(dynamic link library)
dll are implemented by oops concepts.by default dll are supported by cui
features(character user interface)
• dll are directly not executable.it is reusable concept from the .net framework.
• suppose we can create our own dll. this dll file reference to any application
• dll is converts into .exe file. class libraries one more reference name is called
assembly.
• Assemblies are classified into 3 types
• 1.private assembly
• 2.shared assembly
• 3.satellite assembly
• with extension .exe called application without exception .dll called
assembly
• 1.Private assembly:
• This is the module level dll. These dll files are implemented by oops
concept. private assembly dll is distributed only one application at a time.
it doesn't supports version, key file, Gac(Glabal assembly cache);
• example private assembly:
• 1.open vs-2012
• 2.file-new-project-classlibrary-ok
• namespace privateassembly
• {
• public class student
• {
• public int add(int a, int b)
• {
• return a + b;
• }
• public string addstr(string s1, string s2)
• {
• return s1 + s2;
• }
• public string display(string s)
• {
• return s;
• }
• }
• }
• Compile:
• goto-bulid -bulid solution-getting privateassebly.dll this dll file directly not
executable. its reusable concept. private assembly reference to console
application:
• 1.vs-2012
• 2.file -new -project-console application-ok
• add private assembly dll in the console application:
• goto -project menu-add reference-click on browse-privateassembly.dll-ok
• using privateassembly;
• static void Main(string[] args)
• { student obj = new student();
• Console.WriteLine(obj.add(100, 200).ToString());
• Console.WriteLine(obj.addstr("suresh", "technologies"));
• Console.ReadLine();
• }
• 2.Shared assembly:
• Shared assembly is module level dll. This dll file is implemented by oops
concepts.
• Shared assembly dll is distributed multiple applications.
• It supports version, key file, GAC(global assembly cache) shared assembly is also
called as public assembly.
• Shares assemblies sharing features from the assembly folder
c:windowsassembly
• This folder getting automatically while installing .net framework in the
windows folder.
• Shared assembly dll file depending on the unique version. we can create the
shared assembly following 5 steps.
• step 1:create shared assembly
• step 2:create strong name key
• step 3:strong name key reference to the shared assembly
• step 4:install the shared assembly in the assembly folder using
• Gacutil command
• step 5:shared assembly dll file reference to the windows
application
• strong name key file(.snk)
• using snk file(.snk) we can give unique version to the shared
assembly
• dll file
• version communicator between exe and shared assembly dll
file
sn command options:
• -k(key file):
• this command is used to creaye key file. by combining sn -k we can get file and
unique version
• syntax:
• sn -k filename.snk
• sn -k abc.snk
• sn is the .net framework dos command prompt.
• GACUtil(global assembly cache)
• gacutil is .net framework dos command prompt. using this command we can
install the assembly and uninstall assembly.
• Gacutil command options:
• 1.-i(install):
• using this command we can install shared assembly dll file
into assembly folder.
• 2.-U(uninstall):
• using this command we can uninstall shared assembly dll file
into assembly folder.
• example on shared assembly:
• step 1:create shared assembly
• step 2:create strong name key
• step 3:strong name key reference to the shared assembly
• step 4:install the shared assembly in the assembly folder using
• Gacutil command
• step 5:shared assembly dll file reference to the windows application
• step 1:create shared assembly
• 1.file-new-project-classlibrary-sharedassembly-ok
• code:
• namespace sharedassembly
• { public class Class1
• {
• public int tsal(int sal, int bonus, int ta)
• {
• return sal + bonus + ta;
• }
• public string display(string s)
• {
• return s;
• }
• }
• }
• Compilation:
• goto build-build solution-after getting sharedassembly.dll
• E:7pmonlinesharedassemblysharedassemblybinDebugsharedass
embly.dll
• copy the sharedassembly.dll path.
• step 2:create strongname key(.snk):
• to create strong name key in vs-dos command prompt
• how to open vs-crosstools command prompt:
• start-all programs-vs-2012-vstools-vs cross tools command
prompt-
• right click-Run as Administrator
• open vs-command promt
• c:>e:
• e:>cd paste sharedassembly.dll path
• e:>cd
E:7pmonlinesharedassemblysharedassemblybinDebug
• e:7pmonlineSaSaBindebug>dir(display all files)
• sharedassembly.dll
• sharedassemly.pdb
• e>7pmonlinesasabindebug>sn -k abc.snk
• key pair written to abc.snk
• step 3:strong name key reference to the shared assembly
• Assemblyinfo.cs:
• It is also called as metadata
• this file is used to give information about dll file(or)exe file.
Metadata means it gives the complete information about assembly
ie assembly key file, tile, version etc.
• go to solution explorer
• click on properties-click on assemblyinfo.cs
• [assembly:AssemblyKeyFile("E:7pmonlinesharedassemblyshare
dassemblybinDebugabc.snk")]
• goto -build-build solution-dll file
• step 4:install the shared assembly in the assembly folder using
• Gacutil command
• GAC (global assembly cache)
• using this command we install, uninstall assembly in the GAC folder
• open vs studio command prompt: e:7pmonlinesabindebug>gacutil -i sharedassembly.dll
• assembly successfully added to cache.
• step 5:shared assembly dll file reference to the windows application
• open -vs-2012 file-New-Project-windows application in the add button control
• add sharedassembly dll reference
• goto-project menu-add reference-browse-sharedassembly.dll
• using sharedassembly;
• private void button1_Click(object sender, EventArgs e)
• {
• Class1 obj = new Class1();
• MessageBox.Show(obj.tsal(15000, 5000, 500).ToString());
• MessageBox.Show(obj.display("sureshtechnologies"));
• }
• Satellite assembly:
• This assembly is supported only globalization and localization. we can
converts local language into global language. global language into local
language.
• Globalization:
• It involves writing the executable code for an application in such a way that
makes it culture-neutral and language neutral.
• Localization:
• It involves the customization of an application for specific local language. in
the satellite assembly add Resource file . Resource file extension is .resx
• Example on Multi-Language Application:
• 1.take the form
• 2.add 2 labels,2 textboxes,2 buttons,3 Link Buttons
• 3.add 3 Resource Files
Example
• using System.Reflection;
• using System.Resources;
• using System.Globalization;
• CultureInfo ci;
• ResourceManager rm;
• private void Form1_Load(object sender, EventArgs e)
• {
• rm = new ResourceManager("MultiLang.MyRes", Assembly.GetExecutingAssembly());
• }
• private void getvalues()
• {
• label1.Text=rm.GetString("L1",ci);
• label2.Text=rm.GetString("L2",ci);
• button1.Text=rm.GetString("B1",ci);
• button2.Text=rm.GetString("B2",ci);
• }
• private void linkLabel1_LinkClicked(object sender,
LinkLabelLinkClickedEventArgs e)
• { ci = new CultureInfo("en-US");
• getvalues();
• }
• private void linkLabel2_LinkClicked(object sender,
LinkLabelLinkClickedEventArgs e)
• { ci = new CultureInfo("hi-IN");
• getvalues();
• }
• private void linkLabel3_LinkClicked(object sender,
LinkLabelLinkClickedEventArgs e)
• { ci = new CultureInfo("te-IN");
• getvalues();
• }
SIRYKT
Sharing Knowledge is Learning
For more updates
For more visit our website www.sirykt.blogspot.com

More Related Content

What's hot

Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With SeleniumMarakana Inc.
 
Rebuild presentation - IoT Israel MeetUp
Rebuild presentation - IoT Israel MeetUpRebuild presentation - IoT Israel MeetUp
Rebuild presentation - IoT Israel MeetUpYan Vugenfirer
 
Docker for .net developer
Docker for .net developerDocker for .net developer
Docker for .net developerTung Nguyen Thanh
 
Building an Extensible, Resumable DSL on Top of Apache Groovy
Building an Extensible, Resumable DSL on Top of Apache GroovyBuilding an Extensible, Resumable DSL on Top of Apache Groovy
Building an Extensible, Resumable DSL on Top of Apache Groovyjgcloudbees
 
Tribal Nova Docker feedback
Tribal Nova Docker feedbackTribal Nova Docker feedback
Tribal Nova Docker feedbackNicolas Degardin
 
TDC2016POA | Trilha Cloud Computing - Source-to-image - How to transform any ...
TDC2016POA | Trilha Cloud Computing - Source-to-image - How to transform any ...TDC2016POA | Trilha Cloud Computing - Source-to-image - How to transform any ...
TDC2016POA | Trilha Cloud Computing - Source-to-image - How to transform any ...tdc-globalcode
 
Utilizing the OpenNTF Domino API
Utilizing the OpenNTF Domino APIUtilizing the OpenNTF Domino API
Utilizing the OpenNTF Domino APIOliver Busse
 
New Perl module Container::Buildah - SVPerl presentation
New Perl module Container::Buildah - SVPerl presentationNew Perl module Container::Buildah - SVPerl presentation
New Perl module Container::Buildah - SVPerl presentationIan Kluft
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101Naukri.com
 
Trying to Sell PVS-Studio to Google, or New Bugs in Chromium
Trying to Sell PVS-Studio to Google, or New Bugs in ChromiumTrying to Sell PVS-Studio to Google, or New Bugs in Chromium
Trying to Sell PVS-Studio to Google, or New Bugs in ChromiumAndrey Karpov
 
Pimp your jenkins platform with docker - Devops.com 2015/11
Pimp your jenkins platform with docker - Devops.com 2015/11Pimp your jenkins platform with docker - Devops.com 2015/11
Pimp your jenkins platform with docker - Devops.com 2015/11CloudBees
 
PowerShell for Cyber Warriors - Bsides Knoxville 2016
PowerShell for Cyber Warriors - Bsides Knoxville 2016PowerShell for Cyber Warriors - Bsides Knoxville 2016
PowerShell for Cyber Warriors - Bsides Knoxville 2016Russel Van Tuyl
 
Eclipse IDE, 2019.09, Java Development
Eclipse IDE, 2019.09, Java Development Eclipse IDE, 2019.09, Java Development
Eclipse IDE, 2019.09, Java Development Pei-Hsuan Hsieh
 
Azure Meetup Stuttgart - Multi-arch Docker images
Azure Meetup Stuttgart - Multi-arch Docker imagesAzure Meetup Stuttgart - Multi-arch Docker images
Azure Meetup Stuttgart - Multi-arch Docker imagesStefan Scherer
 
ACM Gazi Docker?
ACM Gazi Docker?ACM Gazi Docker?
ACM Gazi Docker?kloia
 
MyFaces CODI Conversations
MyFaces CODI ConversationsMyFaces CODI Conversations
MyFaces CODI Conversationsos890
 
Extending NetBeans IDE
Extending NetBeans IDEExtending NetBeans IDE
Extending NetBeans IDEGeertjan Wielenga
 
Make JSF more type-safe with CDI and MyFaces CODI
Make JSF more type-safe with CDI and MyFaces CODIMake JSF more type-safe with CDI and MyFaces CODI
Make JSF more type-safe with CDI and MyFaces CODIos890
 

What's hot (20)

Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With Selenium
 
Rebuild presentation - IoT Israel MeetUp
Rebuild presentation - IoT Israel MeetUpRebuild presentation - IoT Israel MeetUp
Rebuild presentation - IoT Israel MeetUp
 
Docker for .net developer
Docker for .net developerDocker for .net developer
Docker for .net developer
 
Building an Extensible, Resumable DSL on Top of Apache Groovy
Building an Extensible, Resumable DSL on Top of Apache GroovyBuilding an Extensible, Resumable DSL on Top of Apache Groovy
Building an Extensible, Resumable DSL on Top of Apache Groovy
 
Tribal Nova Docker feedback
Tribal Nova Docker feedbackTribal Nova Docker feedback
Tribal Nova Docker feedback
 
TDC2016POA | Trilha Cloud Computing - Source-to-image - How to transform any ...
TDC2016POA | Trilha Cloud Computing - Source-to-image - How to transform any ...TDC2016POA | Trilha Cloud Computing - Source-to-image - How to transform any ...
TDC2016POA | Trilha Cloud Computing - Source-to-image - How to transform any ...
 
Utilizing the OpenNTF Domino API
Utilizing the OpenNTF Domino APIUtilizing the OpenNTF Domino API
Utilizing the OpenNTF Domino API
 
PIC your malware
PIC your malwarePIC your malware
PIC your malware
 
New Perl module Container::Buildah - SVPerl presentation
New Perl module Container::Buildah - SVPerl presentationNew Perl module Container::Buildah - SVPerl presentation
New Perl module Container::Buildah - SVPerl presentation
 
Cmake
CmakeCmake
Cmake
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
 
Trying to Sell PVS-Studio to Google, or New Bugs in Chromium
Trying to Sell PVS-Studio to Google, or New Bugs in ChromiumTrying to Sell PVS-Studio to Google, or New Bugs in Chromium
Trying to Sell PVS-Studio to Google, or New Bugs in Chromium
 
Pimp your jenkins platform with docker - Devops.com 2015/11
Pimp your jenkins platform with docker - Devops.com 2015/11Pimp your jenkins platform with docker - Devops.com 2015/11
Pimp your jenkins platform with docker - Devops.com 2015/11
 
PowerShell for Cyber Warriors - Bsides Knoxville 2016
PowerShell for Cyber Warriors - Bsides Knoxville 2016PowerShell for Cyber Warriors - Bsides Knoxville 2016
PowerShell for Cyber Warriors - Bsides Knoxville 2016
 
Eclipse IDE, 2019.09, Java Development
Eclipse IDE, 2019.09, Java Development Eclipse IDE, 2019.09, Java Development
Eclipse IDE, 2019.09, Java Development
 
Azure Meetup Stuttgart - Multi-arch Docker images
Azure Meetup Stuttgart - Multi-arch Docker imagesAzure Meetup Stuttgart - Multi-arch Docker images
Azure Meetup Stuttgart - Multi-arch Docker images
 
ACM Gazi Docker?
ACM Gazi Docker?ACM Gazi Docker?
ACM Gazi Docker?
 
MyFaces CODI Conversations
MyFaces CODI ConversationsMyFaces CODI Conversations
MyFaces CODI Conversations
 
Extending NetBeans IDE
Extending NetBeans IDEExtending NetBeans IDE
Extending NetBeans IDE
 
Make JSF more type-safe with CDI and MyFaces CODI
Make JSF more type-safe with CDI and MyFaces CODIMake JSF more type-safe with CDI and MyFaces CODI
Make JSF more type-safe with CDI and MyFaces CODI
 

Similar to 1assembly in c#

Assemblies
AssembliesAssemblies
AssembliesJanas Khan
 
Csharp introduction
Csharp introductionCsharp introduction
Csharp introductionSireesh K
 
NDK Programming in Android
NDK Programming in AndroidNDK Programming in Android
NDK Programming in AndroidArvind Devaraj
 
introduction to c #
introduction to c #introduction to c #
introduction to c #Sireesh K
 
Assign / change strong name to existing assembly
Assign / change strong name to existing assemblyAssign / change strong name to existing assembly
Assign / change strong name to existing assemblyEdwin Reyes Estrada
 
Embedded Systems: Lecture 13: Introduction to GNU Toolchain (Build Tools)
Embedded Systems: Lecture 13: Introduction to GNU Toolchain (Build Tools)Embedded Systems: Lecture 13: Introduction to GNU Toolchain (Build Tools)
Embedded Systems: Lecture 13: Introduction to GNU Toolchain (Build Tools)Ahmed El-Arabawy
 
Anatomy of a Codename One Application
Anatomy of a Codename One ApplicationAnatomy of a Codename One Application
Anatomy of a Codename One ApplicationShaiAlmog1
 
An introduction to maven gradle and sbt
An introduction to maven gradle and sbtAn introduction to maven gradle and sbt
An introduction to maven gradle and sbtFabio Fumarola
 
Introduction to Software Build Technology
Introduction to Software Build TechnologyIntroduction to Software Build Technology
Introduction to Software Build TechnologyPhilip Johnson
 
109842496 jni
109842496 jni109842496 jni
109842496 jniVishal Singh
 
Intro to .NET and Core C#
Intro to .NET and Core C#Intro to .NET and Core C#
Intro to .NET and Core C#Jussi Pohjolainen
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITPouriaQashqai1
 
(ATS3-DEV02) Scripting with .NET Assemblies in Symyx Notebook
(ATS3-DEV02) Scripting with .NET Assemblies in Symyx Notebook(ATS3-DEV02) Scripting with .NET Assemblies in Symyx Notebook
(ATS3-DEV02) Scripting with .NET Assemblies in Symyx NotebookBIOVIA
 
DLL Design with Building Blocks
DLL Design with Building BlocksDLL Design with Building Blocks
DLL Design with Building BlocksMax Kleiner
 
Composer JSON kills make files
Composer JSON kills make filesComposer JSON kills make files
Composer JSON kills make filesropsu
 
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013DuckMa
 

Similar to 1assembly in c# (20)

Assemblies
AssembliesAssemblies
Assemblies
 
Csharp introduction
Csharp introductionCsharp introduction
Csharp introduction
 
NDK Programming in Android
NDK Programming in AndroidNDK Programming in Android
NDK Programming in Android
 
introduction to c #
introduction to c #introduction to c #
introduction to c #
 
Assign / change strong name to existing assembly
Assign / change strong name to existing assemblyAssign / change strong name to existing assembly
Assign / change strong name to existing assembly
 
Embedded Systems: Lecture 13: Introduction to GNU Toolchain (Build Tools)
Embedded Systems: Lecture 13: Introduction to GNU Toolchain (Build Tools)Embedded Systems: Lecture 13: Introduction to GNU Toolchain (Build Tools)
Embedded Systems: Lecture 13: Introduction to GNU Toolchain (Build Tools)
 
Anatomy of a Codename One Application
Anatomy of a Codename One ApplicationAnatomy of a Codename One Application
Anatomy of a Codename One Application
 
An introduction to maven gradle and sbt
An introduction to maven gradle and sbtAn introduction to maven gradle and sbt
An introduction to maven gradle and sbt
 
Dot net assembly
Dot net assemblyDot net assembly
Dot net assembly
 
Introduction to Software Build Technology
Introduction to Software Build TechnologyIntroduction to Software Build Technology
Introduction to Software Build Technology
 
109842496 jni
109842496 jni109842496 jni
109842496 jni
 
Intro to .NET and Core C#
Intro to .NET and Core C#Intro to .NET and Core C#
Intro to .NET and Core C#
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GIT
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Linkers
LinkersLinkers
Linkers
 
(ATS3-DEV02) Scripting with .NET Assemblies in Symyx Notebook
(ATS3-DEV02) Scripting with .NET Assemblies in Symyx Notebook(ATS3-DEV02) Scripting with .NET Assemblies in Symyx Notebook
(ATS3-DEV02) Scripting with .NET Assemblies in Symyx Notebook
 
DLL Design with Building Blocks
DLL Design with Building BlocksDLL Design with Building Blocks
DLL Design with Building Blocks
 
Composer JSON kills make files
Composer JSON kills make filesComposer JSON kills make files
Composer JSON kills make files
 
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
 

More from Sireesh K

More from Sireesh K (20)

Cn10
Cn10Cn10
Cn10
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
 
What is mvc
What is mvcWhat is mvc
What is mvc
 
31c
31c31c
31c
 
31cs
31cs31cs
31cs
 
45c
45c45c
45c
 
44c
44c44c
44c
 
43c
43c43c
43c
 
42c
42c42c
42c
 
41c
41c41c
41c
 
40c
40c40c
40c
 
39c
39c39c
39c
 
38c
38c38c
38c
 
37c
37c37c
37c
 
35c
35c35c
35c
 
34c
34c34c
34c
 
33c
33c33c
33c
 
30c
30c30c
30c
 
29c
29c29c
29c
 

Recently uploaded

Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)Dr. Mazin Mohamed alkathiri
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 

Recently uploaded (20)

Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 

1assembly in c#

  • 2. • Reusable concepts in c#.net: • c#.net supports 2 types of reusable concepts • 1.class Library(namespace) • 2.windows forms control library(control) • 1.Class library: • It is the collection of namespaces. every namespace one dll(dynamic link library) dll are implemented by oops concepts.by default dll are supported by cui features(character user interface) • dll are directly not executable.it is reusable concept from the .net framework. • suppose we can create our own dll. this dll file reference to any application • dll is converts into .exe file. class libraries one more reference name is called assembly.
  • 3. • Assemblies are classified into 3 types • 1.private assembly • 2.shared assembly • 3.satellite assembly • with extension .exe called application without exception .dll called assembly • 1.Private assembly: • This is the module level dll. These dll files are implemented by oops concept. private assembly dll is distributed only one application at a time. it doesn't supports version, key file, Gac(Glabal assembly cache);
  • 4. • example private assembly: • 1.open vs-2012 • 2.file-new-project-classlibrary-ok • namespace privateassembly • { • public class student • { • public int add(int a, int b) • { • return a + b; • } • public string addstr(string s1, string s2) • { • return s1 + s2; • } • public string display(string s) • { • return s; • } • } • }
  • 5. • Compile: • goto-bulid -bulid solution-getting privateassebly.dll this dll file directly not executable. its reusable concept. private assembly reference to console application: • 1.vs-2012 • 2.file -new -project-console application-ok • add private assembly dll in the console application: • goto -project menu-add reference-click on browse-privateassembly.dll-ok • using privateassembly; • static void Main(string[] args) • { student obj = new student(); • Console.WriteLine(obj.add(100, 200).ToString()); • Console.WriteLine(obj.addstr("suresh", "technologies")); • Console.ReadLine(); • }
  • 6. • 2.Shared assembly: • Shared assembly is module level dll. This dll file is implemented by oops concepts. • Shared assembly dll is distributed multiple applications. • It supports version, key file, GAC(global assembly cache) shared assembly is also called as public assembly. • Shares assemblies sharing features from the assembly folder c:windowsassembly • This folder getting automatically while installing .net framework in the windows folder. • Shared assembly dll file depending on the unique version. we can create the shared assembly following 5 steps.
  • 7. • step 1:create shared assembly • step 2:create strong name key • step 3:strong name key reference to the shared assembly • step 4:install the shared assembly in the assembly folder using • Gacutil command • step 5:shared assembly dll file reference to the windows application • strong name key file(.snk) • using snk file(.snk) we can give unique version to the shared assembly • dll file • version communicator between exe and shared assembly dll file
  • 8. sn command options: • -k(key file): • this command is used to creaye key file. by combining sn -k we can get file and unique version • syntax: • sn -k filename.snk • sn -k abc.snk • sn is the .net framework dos command prompt. • GACUtil(global assembly cache) • gacutil is .net framework dos command prompt. using this command we can install the assembly and uninstall assembly.
  • 9. • Gacutil command options: • 1.-i(install): • using this command we can install shared assembly dll file into assembly folder. • 2.-U(uninstall): • using this command we can uninstall shared assembly dll file into assembly folder. • example on shared assembly: • step 1:create shared assembly • step 2:create strong name key • step 3:strong name key reference to the shared assembly • step 4:install the shared assembly in the assembly folder using
  • 10. • Gacutil command • step 5:shared assembly dll file reference to the windows application • step 1:create shared assembly • 1.file-new-project-classlibrary-sharedassembly-ok • code: • namespace sharedassembly • { public class Class1 • { • public int tsal(int sal, int bonus, int ta) • { • return sal + bonus + ta; • } • public string display(string s) • { • return s; • } • } • }
  • 11. • Compilation: • goto build-build solution-after getting sharedassembly.dll • E:7pmonlinesharedassemblysharedassemblybinDebugsharedass embly.dll • copy the sharedassembly.dll path. • step 2:create strongname key(.snk): • to create strong name key in vs-dos command prompt • how to open vs-crosstools command prompt: • start-all programs-vs-2012-vstools-vs cross tools command prompt- • right click-Run as Administrator
  • 12. • open vs-command promt • c:>e: • e:>cd paste sharedassembly.dll path • e:>cd E:7pmonlinesharedassemblysharedassemblybinDebug • e:7pmonlineSaSaBindebug>dir(display all files) • sharedassembly.dll • sharedassemly.pdb • e>7pmonlinesasabindebug>sn -k abc.snk • key pair written to abc.snk • step 3:strong name key reference to the shared assembly
  • 13. • Assemblyinfo.cs: • It is also called as metadata • this file is used to give information about dll file(or)exe file. Metadata means it gives the complete information about assembly ie assembly key file, tile, version etc. • go to solution explorer • click on properties-click on assemblyinfo.cs • [assembly:AssemblyKeyFile("E:7pmonlinesharedassemblyshare dassemblybinDebugabc.snk")] • goto -build-build solution-dll file • step 4:install the shared assembly in the assembly folder using • Gacutil command
  • 14. • GAC (global assembly cache) • using this command we install, uninstall assembly in the GAC folder • open vs studio command prompt: e:7pmonlinesabindebug>gacutil -i sharedassembly.dll • assembly successfully added to cache. • step 5:shared assembly dll file reference to the windows application • open -vs-2012 file-New-Project-windows application in the add button control • add sharedassembly dll reference • goto-project menu-add reference-browse-sharedassembly.dll • using sharedassembly; • private void button1_Click(object sender, EventArgs e) • { • Class1 obj = new Class1(); • MessageBox.Show(obj.tsal(15000, 5000, 500).ToString()); • MessageBox.Show(obj.display("sureshtechnologies")); • }
  • 15. • Satellite assembly: • This assembly is supported only globalization and localization. we can converts local language into global language. global language into local language. • Globalization: • It involves writing the executable code for an application in such a way that makes it culture-neutral and language neutral. • Localization: • It involves the customization of an application for specific local language. in the satellite assembly add Resource file . Resource file extension is .resx • Example on Multi-Language Application: • 1.take the form • 2.add 2 labels,2 textboxes,2 buttons,3 Link Buttons • 3.add 3 Resource Files
  • 16. Example • using System.Reflection; • using System.Resources; • using System.Globalization; • CultureInfo ci; • ResourceManager rm; • private void Form1_Load(object sender, EventArgs e) • { • rm = new ResourceManager("MultiLang.MyRes", Assembly.GetExecutingAssembly()); • } • private void getvalues() • { • label1.Text=rm.GetString("L1",ci); • label2.Text=rm.GetString("L2",ci); • button1.Text=rm.GetString("B1",ci); • button2.Text=rm.GetString("B2",ci); • }
  • 17. • private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) • { ci = new CultureInfo("en-US"); • getvalues(); • } • private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) • { ci = new CultureInfo("hi-IN"); • getvalues(); • } • private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) • { ci = new CultureInfo("te-IN"); • getvalues(); • }
  • 19. For more updates For more visit our website www.sirykt.blogspot.com