What are the ways to deploy an assembly

Posted on 2006-05-04
Last Modified: 2008-02-01
What are the ways to deploy an assembly
Question by:chuang4630
    LVL 4

    Accepted Solution

    Assembly have two types, Global Assembly and local Assembly.
    - Local Assembly: Often when you complied a class, you have an Assembly and just referenced to it in your Application Project whenever you want. This kind of assembly will be copy to your local bin directory.
    - Global Assembly: can be consider to be public use. Before we use this kind of Assembly, we need a strong name for it - a GUID. Then put (install) it on the Global Assembly Cache. Below is how to create and register Global Assembly.
    (The material is copy from Microsoft site.)
    1. A strong name is needed. To generate this cryptographic key pair, use the SN Tool, which is located in the \bin subdirectory, where the .NET Framework Solution Developer Kit (SDK) is installed. The SN Tool is very easy to use. The command-line statement takes the following form:
    sn -k "C:\[DirectoryToPlaceKey]\[KeyName].snk"  
    2. For convenience, create a directory named GACDemo in C:\ so that you can easily locate the key and access the key from the command prompt.

    NOTE: For most users, the .NET tools are located in C:\Program Files\Microsoft.NET\FrameworkSDK\Bin. Before you type the following SN command, you may want to copy this similar path on your computer to the .NET bin directory, type cd from the command prompt, right-click to paste the path, and then press ENTER to quickly change the directory where the SN Tool is located.

    Type the following:
    sn -k "C:\GACDemo\GACkey.snk"
    Note In the .NET Framework 2.0, the .NET tools are located in the C:\Program Files\Microsoft.NET\SDK\v2.0\Bin folder.  
    3. A key is generated, but it is not yet associated with the project's assembly. To create this association, double-click the AssemblyInfo.vb file in the Visual Studio .NET or Visual Studio 2005 Solution Explorer. Add the following to the list of assembly attributes that are included in this file by default when a project is created in Visual Studio .NET or in Visual Studio 2005:
    <Assembly: AssemblyKeyFile("C:\GACDemo\GACKey.snk")>
    Compile the project by clicking CTRL+SHIFT+B. No further code is necessary at this point in order to install a .dll file in the GAC.  
    4. You can install the .dll file by using the Gacutil Tool or by dragging the .dll file into the appropriate directory. If you use the Gacutil Tool, you can use the following command:
    gacutil -I "C:\[PathToBinDirectoryInVSProject]\gac.dll"
    If you want to drag the file, use Microsoft Windows Explorer. Open two instances of Windows Explorer. In one, navigate to the location of the .dll file output for your console project. In the other, navigate to c:\[SystemRoot]\Assembly.

    Drag your .dll file into the folder.
    LVL 1

    Author Comment

    What is satellite assembly?
    LVL 4

    Expert Comment

    Assemblies which contains only culture information are known as satellite assemblies. Satellite assemblies are often used to deploy language-specific resources for an application.
    LVL 4

    Expert Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    In one of my recent projects, I was working with IP cameras, I need to take some pictures from the camera and do some processing on it. The first step, was to retrieve the image from camera into Image object. So that it can be displayed or …
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now