构建项目时的权限问题

dis*_*ney 11 windows visual-studio-2010

我试图在一台机器上建立一个项目,但我得到以下内容:

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.
Run Code Online (Sandbox Code Playgroud)

我使用的用户帐户是计算机上的管理员,那么是否应该没有最高权限?

我可以去启动并右键单击并以管理员身份运行,这可能会对其进行排序,但我尝试自动构建并运行此项目,因此我无法使用该方法.

有谁知道我怎么解决这个问题?

小智 12

Solution Explorer - > [YourProject] - > Properties-> Linker - > General-> Per-user Redirection"TRUE"


san*_*ago 5

在C ++ ATL项目上工作时,我发现了同样的问题。

就我而言,当我添加新的ATL类时,我在资源文件(.rc)中缺少一行,该行添加了新类资源文件(.rgs)的资源类型“注册表”。这会产生与上述相同的权限问题。


Jah*_*mic 5

@LittleFairy 答案可能是最好的。但您可以以管理员身份运行 Visual Studio。

注意:您需要以管理员身份显式启动 Visual Studio。仅具有管理员权限的用户帐户是不够的。