我正在尝试在一台机器上构建一个项目,但我得到以下内容:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(744,5): warning MSB3075: The command "regsvr32 /s "C:\builds\working\\Win32\Debug\projx86.dll"" exited with code 5. Please verify that you have sufficient rights to run this command.
The previous error was converted to a warning because the task was called with ContinueOnError=true.
Build continuing because "ContinueOnError" on the task "Exec" is set to "true".
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(756,5): error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions.
我使用的用户帐户是计算机上的管理员,所以不应该拥有最高权限吗?
我可以去创业并右键单击并以管理员身份运行,这可能会对其进行排序,但我尝试自动构建并运行此项目,因此我无法使用该方法。
任何人都知道如何解决这个问题?
答案 0 :(得分:11)
Solution Explorer - > [YourProject] - > Properties-> Linker - > General-> Per-user Redirection“TRUE”
答案 1 :(得分:4)
在处理C ++ ATL项目时,我发现了同样的问题。
在我的情况下,当我添加一个新的ATL类时,我在资源文件(.rc)中缺少一行,它添加了新类资源文件(.rgs)的资源类型“registry”。这会产生上述相同的权限问题。
答案 2 :(得分:3)
@LittleFairy answer is probably the best. But you could run Visual Studio as administrator.
Note: You need to explicitly start Visual Studio as administrator. Just the user account having admin rights isn't enough.