How to Publish an Assembly

What are the steps for publishing an assembly. I know all about gacutil.exe, sn.exe, al.exe but i don't know how to use them to publish an assembly. Can someone explain me in detail and where is the GAC folder so that i can view all the assemblies.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


install mylib.dll assembly in GAC
gacutil /i mylib.dll

gacutil /u mylib.dll

Note that you pass the assembly name (not the file name)

The potential problem with /u command that it removes every instance of mylib assembly, regardless
of version number..To avoid it you should specify precisely what you want to remove
gacutil -u mylib,ver1.2.00,loc=it,PublicKeyToken=44cd4ab12f0a88a1

you can list all the shared assemblies in GAC  using:
gacutil /l

another way to install to GAC

1. Make a Public module and put the functions in it.
2. CD to your C:\Windows\Microsoft.NET\Framework\v1.1.4322 folder and type: sn -k c:\mykey.snk
3. Add this to the top of your module:
Imports System.Runtime.CompilerServices
And before the Module:
<assembly: AssemblyKeyFile("c:\mykey.key")>
4. CD back to the v1.1.4322 folder and type this in: gacutil /i c:\project\myassembly.dll

Make sure to replace paths with your actual directories.

Now you can add a reference to the DLL anywhere on your computer without having to move the DLL

On most systems, the Global Assembly Cache (GAC) is stored in the C:\Windows\Assembly\GAC folder.
However, it is possible to move the GAC to another directory by creating a new value named
CacheLocation under the HKEY_LOCAL_MACHINE\Software\Microsoft\Fusion registry key. Moving
the GAC can be useful when testing installation routines or to make it point to a network share.
averma78Author Commented:
I have done this the problem is when i try gacutil /i c:\project\myassembly.dll it give me this Unknown Option: and and when i check gac there is no refrence of my assembly in gac. But if I drag and drop dll into gac it does add a refrence in gac but how to do it from command line.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

the gacutil.exe is stored into ur hard drive at

C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin


so to use it from command line

do this

C:\>Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin gacutil.exe

try and let me know


Edward JoellCommented:
Link in accepted solution does not work.
Edward JoellCommented:
and gacutil produces error  "gacutil" is not recognized as an internal or external command operatable program or batch file.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.