none
gacutil uninstall RRS feed

  • Question

  • I'm trying to do a gacutil uninstall on my .dll, unfortunately it doesn't seem to fully work. I'm making my own com object in c# and doing a simple test using powershell to invoke the constructor...

    To install I did: gacutil /i MyDllName.dll

    Then to uninstall: gacutil.exe /uf MyDllName

    Unfortunately, despite the modifications to my .dll code the original version of my .dll is still executed! I've checked the obvious (not compiling etc.) but can't seem to find any reason for this. I've tried on a second pc and that is the same, first gacutil install works fine but after that i can't make changes...

    Anyone have any ideas? It'll become a bit expensive / time consuming if i need a new pc each time i test :)


    Monday, February 16, 2009 10:24 PM

Answers

  • The /f command line argument causes a re-install.  Just use /u.  COM objects must be registered with Regasm.exe as well.
    Hans Passant.
    • Marked as answer by daemonoid Wednesday, February 18, 2009 7:43 PM
    Wednesday, February 18, 2009 11:15 AM
    Moderator
  • Thanks for the replies!

    It turns out I have to restart powershell, then execute the following:

    .\gacutil.exe /u MyDllName
    .\RegAsm.exe /u MyDllName.dll
    .\RegAsm.exe MyDllName.dll
    .\gacutil.exe /if MyDllName.dll

    Not sure why i need to restart ps, that really doesn't make sense to me but glad i got a resolution, now i can get on with the fun bit!
    • Marked as answer by daemonoid Wednesday, February 18, 2009 7:47 PM
    Wednesday, February 18, 2009 7:47 PM

All replies

  • The /f command line argument causes a re-install.  Just use /u.  COM objects must be registered with Regasm.exe as well.
    Hans Passant.
    • Marked as answer by daemonoid Wednesday, February 18, 2009 7:43 PM
    Wednesday, February 18, 2009 11:15 AM
    Moderator
  • /uf looks like correct switch for uninstalling according to gacutil help:
         /uf <assembly_name>
           Forces uninstall of an assembly by removing all traced references.

    I would check this:
    • Is your DLL really removed from the GAC after gacutil /uf? (Run gacutil /l MyDllName)
    • Does your test work after you uninstall your DLL from GAC (in other words is there a hidden copy of your DLL somewhere)?
    • Doesn't your application use different non-GAC'ed version of your DLL? (Use fuslogvw.exe tool)
    • Are you installing into GAC really a new copy of your DLL? (Check C:\Windows\assembly\GAC* directories and search for your DLL - check its version, size, date)
    Wednesday, February 18, 2009 5:41 PM
    Moderator
  • Thanks for the replies!

    It turns out I have to restart powershell, then execute the following:

    .\gacutil.exe /u MyDllName
    .\RegAsm.exe /u MyDllName.dll
    .\RegAsm.exe MyDllName.dll
    .\gacutil.exe /if MyDllName.dll

    Not sure why i need to restart ps, that really doesn't make sense to me but glad i got a resolution, now i can get on with the fun bit!
    • Marked as answer by daemonoid Wednesday, February 18, 2009 7:47 PM
    Wednesday, February 18, 2009 7:47 PM