Install DLL into the GAC on Windows Server 2012 using Powershell

If like me you may have been accustomed to drag/drop a DLL into the GAC and finding doesn’t work in Windows Server 2012?  There are a number of solutions but sharing a Powershell script I have found useful for this purpose.

From SharePoint Powershell console:

Set-location C:\

[System.Reflection.Assembly]::Load(“System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”)

$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacInstall(“C:\my.dll”)

 

 

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s