Permission Error When Building C++ in VS2010

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 ->项目节点->鼠标右键->属性->链接器->常规->逐用户重定向

原文地址:https://www.cnblogs.com/yefengmeander/p/2887549.html