Is it possible to deploy an assembly to a remote GAC with powershell? But the production machine doesn't have GACUTIL. But the production machine doesn't have GACUTIL. So I can't use that trick! How to Install an Assembly (DLL) to the GAC Using Powershell At work I would typically use gacutil.exe to add dlls to the Global Assembly Cache (GAC), however on a new Windows 2012 server we did not have gacutil installed because we didn't install Visual Studio and didn't plan on installing it if we didn't need to. The entry 'Load a Custom DLL from PowerShell' was posted on October 27th, 2006 at 8:20 pm and is filed under Uncategorized.You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site. Installing DLL Into GAC Using Powershell To install DLL into Global Assembly Cache (GAC) you need Visual Studio or SDK to run gacutil.exe. It’s not convenient when you need to deploy ASP.NET application in IIS. To install DLL into Global Assembly Cache (GAC) you need Visual Studio or SDK to run gacutil.exe. It’s not convenient when you need to deploy ASP.NET application in IIS. This time you can do this with Powershell as described in TechNet article How to Install a DLL to the GAC on Windows Server 2012 Using Only PowerShell by Muhammad Khalid Latif. Add to Global Assembly Cache (GAC) with PowerShell Remoting This script allows the files to be added to GAC (Global Assembly Cache) in a remote machine, using poweshell. Script can run on Server A and It can copy required assemblies from Server A, to Server B and then add to GAC in Server B.
As a SharePoint developer, I find it a lot easier to manually deploy files to the GAC during development instead of allowing Visual Studio to do a complete retract / redeploy. There are tools out there like CKS Dev that give you the “Copy to GAC” option directly from a project, but I’ve found that option does not always get everything in the GAC that I want. As such, I’ve started adding a simple post-build command to copy all newly built DLLs into a “Compiled DLLs” folder in the solution root so I have a consolidated set of assemblies to deploy out to the GAC. Then I run the following PowerShell script that deploys all of the assemblies found in a folder out to the GAC: