我仍在尝试运行我的 easyhook 练习。现在,我收到此错误:
System.ApplicationException: Unable to install assembly in the GAC. This usually indicates either an invalid assembly path or you are not admin.
at EasyHook.NativeAPI.GacInstallAssembly(IntPtr InContext, String InAssemblyPath, String InDescription, String InUniqueID)
at EasyHook.Config.Register(String InDescription, String[] InUserAssemblies)
at HookTest.Program.Main()
问题似乎源于这里:
Config.Register(
"Easy hook test",
"Hook Test.vshost.exe",
"TestInject.dll");
我正在尝试构建的解决方案由两个项目组成,一个库和一个应用程序。构建解决方案后,我将 testinject.dll 复制到 hooktest 调试文件夹,然后在调试模式下运行它。也许我应该使用绝对路径来指示 testinject.dll 在哪里?或在某处添加库?
更新 1
"Easy hook test",
@"Hook Test.vshost.exe",
@"I:\Documents and Settings\foo\Desktop\Hook Test\TestInject\bin\Debug\TestInject.dll");
即使进行了此更改,我也会遇到相同的错误