none
how to automatically add an dll file into global assembly? RRS feed

  • Question


  • I am developing a .dll file, and I can add this file into that "c:\windows\assembly" directory manually, and I can use this dll in my computer perfectly well.
    but how about my client? is there any way to automatically add this .dll file into the assembly in any machine? is it ok to directly copy it to the same directory in client machine?

    and how to deal with the strongly named file? ( that .snk file associated with the .dll). do I need to distribute it to the client together? then how to deal with the directory problem? ie, my .snk file is in "c:\test\test.snk", do I need to put it together with my .dll file and give it to my client? but it's no longer in that directory in the client machine, is it ok?

    I am pretty new to this concept, thank you so much if you can help. :)
    Friday, June 13, 2008 12:21 AM

Answers

  • > I can add this file into that "c:\windows\assembly" directory manually

    This is not a good idea.  The gacutil.exe utility should be used to install into the GAC.

    > but how about my client?

    Make an installer, for example using a Setup Project in Visual Studio.

    1.  Create the project:  Other Project Types \ Setup and Deployment \ Setup Project
    2.  Click the View, Editor, File System menu command.
    3.  Click the Action, Add Special Folder, Global Assembly Cache Folder menu command.
    4.  Click on the Global Assembly Cache Folder in the tree.
    5.  Click Project, Add and choose the proper command to locate the DLL that you want to install in the GAC.  (Use Project Output if possible.)
    6.  Add your main executable to the Application Folder.  Also set up Desktop and Programs Menu as applicable for your application.  See Visual Studio Help for more information on using Setup Projects.
    7.  Build the Setup Project to produce an .msi installer.

    > and how to deal with the strongly named file? ( that .snk file associated with the .dll). do I need to distribute it to the client together?

    No.  It contains your signing key.  Keep it secret.
    Friday, June 13, 2008 1:14 AM

All replies

  • > I can add this file into that "c:\windows\assembly" directory manually

    This is not a good idea.  The gacutil.exe utility should be used to install into the GAC.

    > but how about my client?

    Make an installer, for example using a Setup Project in Visual Studio.

    1.  Create the project:  Other Project Types \ Setup and Deployment \ Setup Project
    2.  Click the View, Editor, File System menu command.
    3.  Click the Action, Add Special Folder, Global Assembly Cache Folder menu command.
    4.  Click on the Global Assembly Cache Folder in the tree.
    5.  Click Project, Add and choose the proper command to locate the DLL that you want to install in the GAC.  (Use Project Output if possible.)
    6.  Add your main executable to the Application Folder.  Also set up Desktop and Programs Menu as applicable for your application.  See Visual Studio Help for more information on using Setup Projects.
    7.  Build the Setup Project to produce an .msi installer.

    > and how to deal with the strongly named file? ( that .snk file associated with the .dll). do I need to distribute it to the client together?

    No.  It contains your signing key.  Keep it secret.
    Friday, June 13, 2008 1:14 AM
  • Thank you dude. :)
    Friday, June 13, 2008 1:20 AM