So I have this Powershell script to install MySql dll in gac.
[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:\Program Files (x86)\MySQL\MySQL Connector Net 6.9.9\Assemblies\v4.5\MySql.Data.Entity.EF6.dll")
This script works fine on Windows Server 2012 R2 but throws exception on windows server 2008 r2.
Exception calling "Load" with "1" argument(s): "Could not load file or assembly 'System.EnterpriseServices, Version=4.0 .0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file spe cified." At C:\Users\Administrator\Desktop\MyScript.ps1:2 char:35 + [System.Reflection.Assembly]::Load <<<< ("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken =b03f5f7f11d50a3a") + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : DotNetMethodException
1) Powershell runned as administrator
2) System.EnterpriseServices exist in the system with 4.0.0 version (Location: C:\Windows\Microsoft.NET\assembly\GAC_64\System.EnterpriseServices)
3) GacUtil is not an option since sdk won't be available on production environment.
Is there any limitation of how we install the Gac on windows server 2008 r2?
Why does the script working in windows server 2012 r2 doesn't work on window server 2008 r2?
Am i missing any setting on Server to get this working?
System.EnterpriseServices
– Daniel A. White