我正在尝试.DLL在GAC. 目前我无法证明它已添加到程序集中。
使用命令
C:\Windows\System32>%programfiles(x86)%\Microsoft SDKs\Windows\v7.0A\Bin\gacutil.exe -i "path\to\my\file.dll"
提示告诉我程序集已添加到缓存中。
检查时
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin>gacutil.exe -l file.dll
它说程序集中有 0 个元素。
通过Powershell命令,我试图添加DLL这样的:
PS C:\WINDOWS\system32> Add-Type -AssemblyName "System.EnterpriseServices"
PS C:\WINDOWS\system32> $publish = 新对象 System.EnterpriseServices.Internal.Publish
PS C:\WINDOWS\system32> $publish.GacInstall("file.dll")
我做错了什么?我怎样才能将.DLL加到GAC?最好的方法(对我来说)是用Powershell.