When we need to register an assembly in the GAC, generally we use the
Global Assembly Cache tool (Gacutil.exe) with this command gacutil -i <assembly
name>
But Gacutil.exe is only for development purposes and should not be used
to install production assemblies into the global assembly cache.
One of the solutions is to use PowerShell to install a DLL into the GAC
(Global Assembly Cache) by doing the following
[Reflection.Assembly]::LoadWithPartialName("System.EnterpriseServices") | Out-Null
[System.EnterpriseServices.Internal.Publish] $publish = new-object System.EnterpriseServices.Internal.Publish
$publish.GacInstall(<<FullFilePathToTheDll>>)
This has to do very little with native PowerShell but rather with
instantiating and using .NET libraries from PowerShell
After that you need to do an IISRESET in the server
Enregistrer un commentaire