为什么 Visual Studio 会尝试注册我的 DLL [英] Why Visual Studio will try to register my DLL

查看:25
本文介绍了为什么 Visual Studio 会尝试注册我的 DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Visual Studio(C++) 2010 来构建 DLL 项目.生成的DLL是一个普通的DLL,使用前不需要注册.

I am using Visual Studio(C++) 2010 to build a DLL project. The generated DLL is a normal DLL and I do not need to register it before using it.

但是,在构建DLL项目时,我总是会收到以下错误信息

However, when building the DLL project, I will always get the following error message

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(744,5):警告 MSB3075:命令regsvr32/s"E:\Projects\MyDLL\Release\MyDLL.dll""以代码 5 退出.请确认您有足够的权限来运行此命令.

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(744,5): warning MSB3075: The command "regsvr32 /s "E:\Projects\MyDLL\Release\MyDLL.dll"" exited with code 5. Please verify that you have sufficient rights to run this command.

之前的错误被转换为警告,因为任务是在 ContinueOnError=true 的情况下调用的.

The previous error was converted to a warning because the task was called with ContinueOnError=true.

构建继续,因为ContinueOnError";在任务Exec"上设置为真".

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):错误 MSB8011:无法注册输出.请尝试启用每用户重定向或使用提升的权限从命令提示符注册组件.

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.

构建失败.

这个问题很奇怪:

  1. 我没有要求 Visual Studio 注册 DLL 的构建后命令.
  2. 我是管理员,所以应该有足够的权限来注册 DLL.

请帮忙.谢谢

推荐答案

您可以在链接器、注册输出下的项目属性中关闭此功能:

You can turn this off in project properties under Linker, Register Output:

这篇关于为什么 Visual Studio 会尝试注册我的 DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆