working with the GAC
Posted on 2005-04-25
I created a brand new vb.net class library project and called it, "MyNewClassLib"
I set the root name-space to "MNCL"
I created c:\mykey.snk via "sn -k c:\mykey2.snk" at the dos command prompt.
Then, I added the following tag after the assembly GUID tag in the AssemblyInfo.vb file:
I changed the assmbly version to 220.127.116.11 via the following change:
<Assembly: AssemblyVersion("18.104.22.168")> '(change from 1.0.* to 22.214.171.124)
I added a line of code to my Class1, just so that my class library has some meat in it...The complete Class1 code is shown below:
Public Class Class1
Public x As Integer
I compiled the project.
Then I use the gac util to register my .dll into the gac. Go to the proper directory where the newly created .dll resides then type the following:
gacutil /i MyNewClassLib.dll
The assembly gets added to the cache, so it says.
Now go to windows explorer, and
browse out to "C:\Windows\assembly"
If you look at the list, I do see "MyClassLib"
I do not see MCLB.MyClassLib
I thought this was strange, as I thought I would see the naumespace.project-name for some reason. There are other listings in the Gac where one does see a period within the Global Assembly Name....
So that's the first question (above)...is to give some clarity on this matter.
The second question is this: now that I got this in the GAC, and I also added the .dll to the required folder which allowed the .dll to be available in the Project / References box.
Supposing that I use this .dll in some new project, and supposing I create a distribution project (installation project / setup project).
When I burn a CD using the output from the setup project, does it automatically add the .dll to the GAC of the target machine?