How to move a dll file to the GAC?

Last post 04-03-2008 10:02 AM by InsanePaul. 12 replies.

Sort Posts:

  • How to move a dll file to the GAC?

    01-30-2008, 12:42 PM
    • Member
      95 point Member
    • InsanePaul
    • Member since 10-31-2007, 5:31 AM
    • Posts 358

    How to move a dll file to the GAC? 

    I'm using a 3rd party component which hasn't fully installed all the dll files to the GAC so they have advised me to copy them over using the gacutil -i command in the VS2008 tool command prompt.

    But I don't have a VS2008 tool (i click start, all programs, and can only select VS2008). So I tried dragging the dll file to the GAC folder using explorer by - c:\windows\assembly but it won't allow me to drop it. How do I do this?

     

  • Re: How to move a dll file to the GAC?

    01-30-2008, 12:54 PM
    • All-Star
      62,314 point All-Star
    • TATWORTH
    • Member since 02-04-2003, 8:34 AM
    • England
    • Posts 12,147
    • TrustedFriends-MVPs

     GacUtil is part of the Framework SDK. the 1.1 version is located at C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322

     Just set up a batch file like:

    C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\gacutil -i component_path
    PAUSE 'Any key to finish'

     

    Don't forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
  • Re: How to move a dll file to the GAC?

    01-30-2008, 12:59 PM
    • All-Star
      20,998 point All-Star
    • Jeev
    • Member since 11-24-2005, 12:49 PM
    • Posts 3,163

    Try using the gacutil from  framework folder  C:\WINDOWS\Microsoft.NET\Framework\version

    and you should be able to install it in the gac 

    Jeev
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    If you get the answer to your question, please mark it as the answer.
  • Re: How to move a dll file to the GAC?

    01-30-2008, 1:16 PM
    • Member
      95 point Member
    • InsanePaul
    • Member since 10-31-2007, 5:31 AM
    • Posts 358

    it says gacutil is not a recognized as an internal or external file

  • Re: How to move a dll file to the GAC?

    01-30-2008, 1:23 PM
    • All-Star
      62,314 point All-Star
    • TATWORTH
    • Member since 02-04-2003, 8:34 AM
    • England
    • Posts 12,147
    • TrustedFriends-MVPs

    Have you searched on your PC for gacutil?

    I have just done a search and found it at C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin and C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322.

    No 2.0 version found. Curious..... 

    Don't forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
  • Re: How to move a dll file to the GAC?

    01-30-2008, 1:34 PM
    • All-Star
      62,314 point All-Star
    • TATWORTH
    • Member since 02-04-2003, 8:34 AM
    • England
    • Posts 12,147
    • TrustedFriends-MVPs

     At http://channel9.msdn.com/ShowPost.aspx?PostID=209954 there is the following advice

    " First off, GACUTIL is part of the .Net SDK not the .Net Redistributible, therefore you are not licensed to redistribute that code.

    Secondly, .Net and the CLR were designed to mitigate the problems associated with sharing library code files that everyone calls DLL Hell, the GAC , if used improperly, reintroduces all the pitfalls that COM DLLs had

    The GAC makes xcopy deployment moot.  If you're going to use the GAC, and since you can't use xcopy now, you should really be using a installation technology that was designed for end-user application installation.. like Windows Installer (MSI).  MSI knows how to register assemblies with the end-user's GAC.  Dont hack the installation APIs by using GACUTIL.

    GACUTIL is for developers not end-users. That's why it's in the SDK but not the Redistributable"

    Don't forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
  • Re: How to move a dll file to the GAC?

    01-30-2008, 1:45 PM
    • Contributor
      3,152 point Contributor
    • pbromberg
    • Member since 06-25-2002, 9:13 AM
    • Orlando FL
    • Posts 500
    • TrustedFriends-MVPs

    Run a Visual Studio 2008 Command prompt and type gacutil /?

    Start / Programs / Microsoft Visual Studio 2008/Visual Studio Tools/Visual Studio 2008 Command prompt.

     You need to have the vsvars32.bat file run in order for the PATH environment variable to allow you to "find" gacutil.

  • Re: How to move a dll file to the GAC?

    01-31-2008, 3:47 AM
    • Member
      95 point Member
    • InsanePaul
    • Member since 10-31-2007, 5:31 AM
    • Posts 358

    Thanks for all your replies but:

    I don't have a Visual Studio Tools option. I click on Visual Studio 2008 Visual Web Developer and it opens up the express edition - no Visual Studio 2008 command prompt. I look in 'tools' in the menu but no command prompt - where is it?

    There is a gacutil.exe.config file in v1.1.4322 but I can't use it - the message I get is given in my previous post

    I installed a MSI from a 3rd party but it didn't install a few assemblies - they said do any of the above but I just cannot seem to do it. Surely drag and drop is the quickest but can't do that either. Since I have the express version perhaps I didn't install or the express version doesn't allow me to do this. everything so I'm going to install the 90 day evaluation of Visual Studio 2008.

  • Re: How to move a dll file to the GAC?

    01-31-2008, 4:12 AM
    • All-Star
      62,314 point All-Star
    • TATWORTH
    • Member since 02-04-2003, 8:34 AM
    • England
    • Posts 12,147
    • TrustedFriends-MVPs

     >I'm going to install the 90 day evaluation of Visual Studio 2008

    That should install the correct version. 

    Don't forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
  • Re: How to move a dll file to the GAC?

    01-31-2008, 5:13 AM
    • Contributor
      5,182 point Contributor
    • Punithkumar
    • Member since 12-18-2007, 2:10 PM
    • Bangalore,Karnataka,India
    • Posts 916

    Try like this,

    /* In Visual studio 2005 command prompt */
    Setting environment for using Microsoft Visual Studio 2005 x86 tools.

    C:\Program Files\Microsoft Visual Studio 8\VC>cd C:\Lab\reflectiondll\reflectiondll\bin\Debug

    C:\Lab\reflectiondll\reflectiondll\bin\Debug>gacutil /i reflectiondll.dll
    Microsoft (R) .NET Global Assembly Cache Utility.  Version 2.0.50727.42
    Copyright (c) Microsoft Corporation.  All rights reserved.

    Assembly successfully added to the cache

    C:\Lab\reflectiondll\reflectiondll\bin\Debug>

    Regards,
    Punithkumar
  • Re: How to move a dll file to the GAC?

    02-01-2008, 4:38 AM
    • Member
      95 point Member
    • InsanePaul
    • Member since 10-31-2007, 5:31 AM
    • Posts 358

    I should be able to do this using web express 2008 - This is what I've been told by the 3rd party component provided:

    Apparently VS2008 moved the gacutil location and that is why the current setup does not do this for you. It should be fixed in the next patch.  That is why you have to run gacutil manually.

     I believe you can download it if you have the express version. 

     I've googled it and tried your suggestions. I don't want to reinstall 2008 at this time however I've downloaded the pro 90 day version but it is an image file so I paid for isobuster to extract the folders but i get a load of "Sector .... couln't be read" messages. Besides, would I have to uninstall the express version before installing the pro version - unfortunatly there isn't any documentation.

    Please can someone tell me exactly what to do.

  • Re: How to move a dll file to the GAC?

    02-05-2008, 6:08 AM
    • Member
      24 point Member
    • dhlennon
    • Member since 10-31-2005, 7:58 PM
    • Posts 6

    You are correct, there is no easy access to GACUTIL if you only have VWD 2008 installed, as far as I could ascertain.

    However you can drag and drop the DLL using windows explorer into c:\windows\assembly (copy and paste not available - you must drag and drop)

    If you are using .net 3.5 that should be all you need to do (worked for me)

    For earlier .net versions you will need to edit the machine.config file which you will find in C:\WINDOWS\Microsoft.NET\Framework\your .net version\CONFIG .
    Add a reference to the dll in the <assemblies> tag.
    The format is <add assembly="AssemblyFileName, Version=0.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxx" />
    You can find the values you need to add by going back to c:\windows\assembly and right-click,select properties for your dll

     Hope this helps.

  • Re: How to move a dll file to the GAC?

    04-03-2008, 10:02 AM
    Answer
    • Member
      95 point Member
    • InsanePaul
    • Member since 10-31-2007, 5:31 AM
    • Posts 358

    If i remember correctly i had to install microsoft.net framework sdk version 2.0 to get the command prompt. There is a gacutil executable file in the microsoft.net\sdk\v2.0\bin folder.

    I then had to turn Account Control off in UserAccounts before running the gacutil -i

    Copy and paste to the command prompt doesnt work in vista (works in XP) but in vista you can still do the same by:

    hold down 'shift'

    right click the file you want to put in the command prompt

    click 'copy as path'

    right click in command prompt

    click paste.

Page 1 of 1 (13 items)