How to extract an assembly from the GAC?

后端 未结 15 1937
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-29 15:29

There is a package I have to deal with which installs assemblies straight into the GAC (e.g. somewhere deep in %windows%/assembly).

How do I exorcise the actual as

相关标签:
15条回答
  • 2020-11-29 15:33

    I am the author of PowerShell GAC. With PowerShell GAC you can extract assemblies from the GAC without depending on GAC internals like changing folder structures.

    Get-GacAssembly SomeCompany* | Get-GacAssemblyFile | Copy-Item -Dest C:\Temp\SomeCompany
    
    0 讨论(0)
  • 2020-11-29 15:34

    Easy way I have found is to open the command prompt and browse through the folder you mention until you find the DLL you want - you can then user the copy command to get it out. Windows Explorer has a "helpful" special view of this folder.

    0 讨论(0)
  • 2020-11-29 15:37

    The method described here is very easy:

    http://andreasglaser.net/post/2008/08/05/Extract-assembly-from-Global-Assembly-Cache-(GAC)-with-network-drive-mapping.aspx

    Summary from Article:

    • Map a Network Drive (Explorer -> Tools)
      • Map to \servername\folder (\\YourServer\C$\Windows\Assembly)
    • No need for sharing if you are the Administrator
    • Browse to the drive and extract your assembly
    0 讨论(0)
  • 2020-11-29 15:38

    Open RUN then type %windir%\assembly\GAC_MSIL, this will open your dlls in folders' view you can then navigate to your dll named folder and open it, you will find your dll file and copy it easily

    0 讨论(0)
  • 2020-11-29 15:40

    From a Powershell script, you can try this. I only had a single version of the assembly in the GAC so this worked just fine.

    cd "c:\Windows\Microsoft.NET\assembly\GAC_MSIL\"
    Get-ChildItem assemblypath -Recurse -Include *.dll |  Copy-Item -Destination "c:\folder to copy to"
    

    where the assembly path can use wildcards.

    0 讨论(0)
  • 2020-11-29 15:44

    Use the file browser "Total Commander" instead.

    1. Enable the "show hidden/system files" setting in Total Commander
    2. Browse to "c:\windows\assembly"
    3. copy
    0 讨论(0)
提交回复
热议问题