我仍然試圖運行easyhook練習。現在,我得到這個錯誤:Easyhook在vs2010發出「無法在GAC中安裝程序集」錯誤
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");
即使有這種變化,我得到了同樣的錯誤
我在我的win XP機器上使用管理員帳戶,因此VS應該以管理員模式運行,並且我已經使用完整路徑編譯而沒有成功。 (愚蠢的問題,我應該使用雙反斜槓,對嗎?「c:\\ mumble \\ foo.dll」) – kaharas 2011-01-07 14:48:39