小编Tim*_* D.的帖子

在 GAC 中注册 DLL(CMD 或 PowerShell)

我正在尝试.DLLGAC. 目前我无法证明它已添加到程序集中。

使用命令

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.

windows dll powershell gac

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

dll ×1

gac ×1

powershell ×1

windows ×1