1. 程式人生 > >已退出,程式碼為 5。請驗證您是否有足夠的許可權來執行此命令

已退出,程式碼為 5。請驗證您是否有足夠的許可權來執行此命令

Warning 1 warning MSB3075: The command "regsvr32 /s "D:\Debug\CBho.dll"" exited with code 5. Please verify that you have sufficient rights to run this command. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets 677 6 CBho

Error 2 error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets 689 6 CBho

warning MSB3075: 命令“regsvr32 /s "D:\NativeAddIn\Release\NativeAddIn.dll"”已退出,程式碼為 5。請驗證您是否有足夠的許可權來執行此命令。
error MSB8011: 未能註冊輸出。請嘗試啟用“逐使用者重定向”,或者使用提升的許可權從命令提示符處註冊該元件。

實際我要註冊的檔案是我自己做的外掛,但它總會提示需要確認許可權,之前搜了很多次都沒找到解決辦法,而且好像是一個很常見的問題,今天搜了一下英文,找到了

解決辦法:
Solution Explorer ->專案節點->滑鼠右鍵->Properties->Linker ->General->Pre-user Redirection 設為TRUE 就好了。

對應的中文版是:

Solution Explorer ->專案節點->滑鼠右鍵->屬性->連結器->常規->逐使用者重定向