Wednesday, 18 January 2017

GAC DLL BY power shell script.


Open Powershell script ISE window as Admin credentials.


[string] $location = "D:\personal\BRE\BRE.Project\BRE.ProjectCL\bin\Debug\"
[string] $dllName = "BRE.ProjectCL.dll"

Set-location $location

[string] $dlllocation =  [string]::Format("{0}{1}",$location,$dllName)


[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
          
$publish = New-Object System.EnterpriseServices.Internal.Publish  
       
$publish.GacInstall($dlllocation)