Creating C# .NET Class Library Assembly Versions and Installing in the GAC Part 1 of 3

Creating C# .NET Class Library Assembly Versions and Installing in the GAC Part 1 of 3


Three part video on how to create .NET class library assemblies and handle multiple versions of the code. Also, how to install them into the Global Assembly Cache (GAC) and again, deal with multiple versions. Doug Rees from Black Bear IT is the presenter.
Closed Caption:

I there my name's degrees
I'm gonna be talking to today about
dotnet assembly versioning
so just
a quick overview all summer the
issues that we face on working with
assemblies in dotnet
and this can be done at one or donate to
doesn't really make any difference
we've got two times assembly story about
we have
Weekly named assemblies with with the
names named
assemblies the version numbers never
checked the version numbers not
important to us
Weekly named assemblies is something
will work with Butler in our development
plates
strongly named assemblies I'm gonna ship
it out to our customer
at that point the version number does
become important
version number will be checked client
applications generally will only load
against the version they were compiled
against unless we redirect manually
I'm gonna see how to work with both the
stop assemblies in the demonstrations
so let's start a demonstration by
taking a look at a very simple little
library plication
this lively application is really just a
straight for class library
I'm using officials to 2005 but the code
would be exactly the same in 2003
so we've got is a
see shop class library with one class
and one method
case we've got a
namespace chord library in class called
simple class medical get data
and it just returns some information
moms gonna reset string now to its
initial state
at the moment because this is going to
be a weekly named assembly
if we look at the version number number
in the assembly in 5 I'll
you see that we've got it set to sort of
the default version
which is 1.0 point Asterix gas tax means
that the two
final numbers the build number the
revision number I can
auto generators will soon see sea otters
were gonna compile a sky
we're gonna go to the client
application we load him up
and he's gonna have a reference to you
that class library the moment a class
library is not strongly named
you can see the version number here that
was generated when we did the
compilation
the 2533 is an approved a since january
first two thousand
and then the 19 437 is the seconds
since midnight the day that you're right
you building this
site all we have inside here's
very very simple test on us its gonna go
and create
the object in the class library its
gonna call the GetData method
and its gonna wait for a us press any
key was going to compile him up as well
just make sure he works
just double-click some data from the
class library
press any key to exit so therefore it's
worked okay so now what we gonna do
is critical be of these files and move
them into server
a test area paste them in here
obviously with dotnet appointment
because you can just deploy the deal
island
the same voters excludable system just
works quite happily
will secrete a backup these two files
and what we're not gonna do is gonna
change the actual
class library DLL to go in here
we're going to modify at the word mode
he minded into here a mostly gonna
change
lashing a letter or to generate a new
version number for me
sewers and recompile it now we going to
crap the actual DLL
and replace it inside the test area
as you can see immediately the client
app is happily using the new version
number
without any jobs at all a seal this
version number is
a case this is nineteen
486 and once the backup folder
19 437 so tell a different version
numbers but both
are working quite happily of course this
guy
is using him because these are
effectively private assemblies
them for they will run in the folder
that they are located in
at this is fine for development
I am however when you want to you ship
it out to
your customers it's no longer in
appropriate use Weekly named
assemblies because there's no security
checking in place on weekly nights
emily's
so we need to do now is me too strong
name
our assembly this has a a few benefits
as will soon see but that
steps for actually strong naming is to
create itself a key pair
using strong name to XE today to sign
the key
using that the attribute the same leaky
on attribute
in the class life itself we will
manually assign a version number
instead of letting it auto generate a
version number we can then compile a
class library Visual Studio
and then we're gonna recompile the
client application once
against that strong named assembly so
let's have a look now
adjust changing it so we can use a
strongly named client library
person with a needed for going to need a
strong name key so wanna do is generate
myself
a from the tonic command prompt strong
name to XE
is the too little going to use minus k
is the switch for saying
generators new key ankle at my key to
addressing
K and you can see that it's now written
a key pair
to you folder where this library could
actually exist
you can see the year the key inside here
yes
in Visual C 2005 there are other ways of
doing this but this is the one that
works for both
2003 and 2005 we now need to change the
version number
to something explicit ourself which
we're going to do by setting it 2-0
and now in its adian assembly
keyfile attribute
pointing at two Mikey
SNK the reason that we need the two
so dot dot slashes is because when we do
the actual compilation
we're actually compiling it from the the
object folder
inside the bin deductible sorry space in
the complex because he a
it has stepped one level up to the
object loader that has a step up again
to the folder that contains the actual
S&K ball because that's our chest to
store
so inaccurate compile s although
actually I just sorry that's one thing
I've got just love them changes the word
strong
just so that we can see that this is now
strongly named assembly I'm gonna
rebuild this one
we've gotta go back to the client
application now
because the client application must be
rebuilt once so that it knows that it
strongly names
and at the moment considered it thinks
it's falls im actually
rebuild the application it will check
and then spot fact that this is now
strongly named assembly
and it's got the version number that
we're expecting and so forth
so now a class library is going to be
using the strong and assembly
Asus checked it that's working and I we
go
class library strong so it is happily
using the strong name simply
win a copy those guys and replace our
original
pay that we had
okay so it's all working in the way you
can tell it's a strong name simply
is to use I'll Dez I was gonna load up
but from the donec mom prompt
I'll de som I'll disassembler
and we're going to go on to find the
actual
doesn't really matter where we're
actually looking for this if we look at
the library itself
and then we look at the manifest policy
is that
inside are manifest for assembly
is a public key which has been in bed by
the attribute
we also see our version number that
we've hard coated in here
if he's out as in to open up the execute
herbal
what you'll see is execute a ble in the
manifest now
references our library assembly and it
knows
our public key token and it knows a
version number and these two values
are always going to be tested by the
dotnet framework when we actually load
up
our client application to look at those
information

Video Length: 08:48
Uploaded By: BlackBearIT
View Count: 19,605

Related Software Products
ClassLibrary
ClassLibrary

Published By:
Online TV

Description:
ClassLibrary is the ultimate code library for developers, teams, and enterprises. It provides the best collection of ready-to-use code snippets, classes, how-to`s, and articles. It also allows you to manage your own code and share knowledge within a team by using the fully searchable code repository. ClassLibrary provides both a full-featured standalone Code Explorer,is the Ultimate Code Library for Programmers. Get a jumpstart into programming with thousands of lines of C# and Visual Basic ...


Related Videos
Bollywood Class Library Flash Mob
Bollywood Class Library Flash Mob

Northwestern's Bollywood "Cultural Forms" class puts on a study break show for students studying in the university library.
Video Length: 04:09
Uploaded By: NUBollywoodDance
View Count: 102,127

Insert,Update,Delete,Select using Three Tier demo using ClassLibrary
Insert,Update,Delete,Select using Three Tier demo using ClassLibrary

Three Tier Architecture Demo for INSERT UPDATE DELETE SELECT
Video Length: 31:33
Uploaded By: Hitesh Rathod
View Count: 33,143

VB.NET Tutorial - Create a DLL / Class Library (Visual Basic .NET)
VB.NET Tutorial - Create a DLL / Class Library (Visual Basic .NET)

In this Visual Basic .NET tutorial I will be showing you how to create and use your own DLL (Dynamic Link Library) in your VB.NET projects. We will create a DLL file for managing form graphics and use that DLL to draw images to forms and form controls. TUTORIAL FEATURES: DLL - Library, Namespace, Class Graphics - System.Drawing, Image Form Controls - Button, PictureBox Class - Image Manager hr / bClosed Caption:/b welcome to the vb ...
Video Length: 32:29
Uploaded By: VB Toolbox
View Count: 29,826

Tutorial - Visual Basic 2010 - How to make a dll/Class Library - L3GiT
Tutorial - Visual Basic 2010 - How to make a dll/Class Library - L3GiT

This video is a tutorial on how to make a .dll also known as an application extension ALSO known as a Class Library in Visual Basic 2010 (.NET 4.0). If you are in need to know how to make a Class Library you probably already decent at programming, but if your not that is still okay as I went over some key features such as Sub and Subs being Private or Public as well as Functions being Private, Public and Public Shared. Private Sub or Private Function: If you see the word ...
Video Length: 10:16
Uploaded By: CmptrPrgmr
View Count: 20,873

A Simple Tutorial on using a Class Library and C# application in one Solution.
A Simple Tutorial on using a Class Library and C# application in one Solution.

A Simple tutorial on creating a class library and implementing a class in a C# application in one solution thereof. Just something to get you started no unnecessary detail. hr / bClosed Caption:/b i'm just going to show you guys how to create a cross librarian and basic example on your current track and we'll just use a class library as sort of a container told all our classes and created the aisle from that and with the ll be able ...
Video Length: 10:01
Uploaded By: Mixo Mushwana
View Count: 19,161

Visual Basic 2008 Tutorial: Class Library / DLL
Visual Basic 2008 Tutorial: Class Library / DLL

This video basically teaches you how to write a class library and deploy it in another application. This is my last video for the year of 2009. Lets say hello to 2010. Please comment, rate and subscribe. Please watch in high quality.
Video Length: 05:15
Uploaded By: monsterhunter445
View Count: 15,348

Using Entity Framework within a Class Library DLL
Using Entity Framework within a Class Library DLL

This short video walks you through how to use the Entity Framework inside of a Class Library DLL so that you can reuse the Library in multiple projects. Source Code: http://www.digioz.com/downloads/tutor... Northwind Database: http://northwinddatabase.codeplex.com/ Website: http://www.digioz.com hr / bClosed Caption:/b in this videofont color="#CCCCCC" I will walk you through/font how to use the entity framework from within a library ...
Video Length: 10:29
Uploaded By: DigiOz Multimedia
View Count: 13,041

Angell EYE PHP Class Library for PayPal Overview
Angell EYE PHP Class Library for PayPal Overview

This is a quick overview of how to use the Angell EYE PHP class library for PayPal to process payments using Payments Pro, Adaptive Payments, or PayFlow Pro. hr / bClosed Caption:/b high winds and rain Jules angel I swim do a quick overview the using this PHP library for Pay Pal their bill makes it pretty quick and easy to integrate a pulse web services and a pretty much me PHP the project might be working on a pretty ...
Video Length: 07:21
Uploaded By: Andrew Angell
View Count: 12,992

Visual Basic Tutorial - 179 - FTP Downloader Part 2   Referencing A Class Library
Visual Basic Tutorial - 179 - FTP Downloader Part 2 Referencing A Class Library

Facebook - https://www.facebook.com/TheNewBoston... GitHub - https://github.com/buckyroberts Google+ - https://plus.google.com/+BuckyRoberts LinkedIn - https://www.linkedin.com/in/buckyroberts reddit - https://www.reddit.com/r/thenewboston/ Support - https://www.patreon.com/thenewboston thenewboston - https://thenewboston.com/ Twitter - https://twitter.com/bucky_roberts hr / bClosed Caption:/b hello youtube same here from YouTube dotbr ...
Video Length: 05:11
Uploaded By: thenewboston
View Count: 10,116

Copyright © 2025, Ivertech. All rights reserved.