Install a dll file in GAC using PowerShell

If you need to install a dll without using Gacutil, you can do it using PowerShell. For this, open a PowerShell prompt as administrator and run below commands:

[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacInstall("F:\Dlls for FBA\Metavrse.SharePoint.SyncLib.dll")
view raw Deploy-Dll-GAC.ps1 hosted with ❤ by GitHub

Do note that the path in the last command should be full path for dll. Otherwise it won’t work.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s