Search This Blog

Showing posts with label GAC. Show all posts
Showing posts with label GAC. Show all posts

Saturday, November 14, 2015

How to find the Version, Culture and PublicKeyToken of an Assembly (DLL) using PowerShell


([system.reflection.assembly]::loadfile("c:\temp\test.dll")).FullName

The output of this PowerShell statement will provide the Version, Culture and PublicKeyToken as shown below.
Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=630d986a50055aa6


Install to global assembly cache without gacutil

In Windows Server 2012 you can't install a DLL to the GAC by drag/drop, but you can do it using GACUTIL.exe.
GacUtil.exe is not present on the server by default.
You can do it using the following script instead of Gacutil.exe

In Windows 2012 you can use the following PowerShell to install dll to GAC

Set-location "c:\temp"
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacInstall("c:\temp\test.dll")
iisreset

In Windows 2012 you can use the following PowerShell to remove dll from GAC:

Set-location "c:\temp"
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacRemove("c:\temp\test.dll")
iisreset


Restricting Custom People Picker to only one Sharepoint group programatically

Refer the following script files in your page,     <!-- For People Picker -->     <script type="text/javascript" src...