Search code examples
c#.net.net-assemblygacgacutil

C# assembly - get path where it was before being registered with gacutil


Is there any way to get the path of an assembly registered with gacutil /i myassembly.dll ?

I mean the path where the .dll file was at the moment it was registered with this command. All that I get right now is the path in the GAC


Solution

  • No. When you register an assembly in GAC, gacutil makes a copy of the dll in Windows\assembly (or Windows\Microsoft.NET\assembly for .NET 4.0). It doesn't keep any info on the location of the original assembly.

    EDIT: You can however add a custom trace to your assembly when installing, using /ir option instead of /i

    gacutil /ir myassembly.dll OPAQUE "Custom application details" "Custom description"
    

    and then retrieve the details using /lr option

    gacutil /lr myassembly.dll
    

    More info on tracing here