解决错误MSB8011:无法注册输出 [英] Solving error MSB8011: Failed to register output

查看:1138
本文介绍了解决错误MSB8011:无法注册输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个奇怪的错误:


错误MSB8011:无法注册输出。请尝试启用每用户
重定向,或从具有
提升权限的命令提示符下注册组件。 C:\Program
文件\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets 744


尝试在ActiveX控件中使用OpenSceneGraph(OSG)时出现此错误。 Google搜索显示了各种解决方案,这些解决方案并不能真正解决问题或找不到错误的确切原因,因此,我想将解决方案放在一个地方:在这里。



我找到了解决方案,并将很快回答我自己的问题,以便人们在遇到相同问题时也能找到解决方案。

解决方案

当Visual Studio(2010)找不到程序创建OCX所需的从属dll文件时,将发生此错误。 OCX在项目的Debug目录中创建(用于Debug版本),并且将工作目录(在项目设置中)指定为依赖DLL所在的文件夹,这将不会帮助Visual Studio定位DLL。 / p>

现在要抓住的是(这使得解决问题变得头疼)有时候,如果没有Visual Studio无法创建OCX,您将无法在OCX上运行Dependency Walker。因此,您永远都不会弄清楚丢失的DLL是问题所在。



如果您知道需要将哪个DLL放置在Debug文件夹中,只需将它们放在此处,然后错误将消失。
如果您不知道并且未创建您的OCX,请转到项目设置>链接器>常规>注册输出
,并将值设置为否。这将为您创建OCX,但不会完成注册过程,即需要依赖的DLL时。



一旦双击OCX和Dependency Walker用黄色圆圈图标向您显示缺少的DLL,只需将这些DLL与OCX放在同一文件夹中,您的程序即可正常运行。就是这么简单。


A strange error:

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\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets 744

I got this error when trying to use OpenSceneGraph (OSG) in an ActiveX control. A Google search showed all kinds of solutions which didn't really solve the problem or locate the exact cause of the error, so I'd like to put the solution in one place: Here.

I found the solution to it, and will be answering my own question soon, so that people can find their solution if they encounter the same problem.

解决方案

This error happens when Visual Studio (2010) can't find the dependent dll files that are required by the program for creating the OCX. The OCX is created in the Debug directory of the project (for Debug builds), and specifying the "Working directory" (in project settings) as the folder where the dependent DLL's are, won't help Visual Studio in locating the DLL's.

Now the catch is (this is what makes it a headache to solve the problem) that sometimes, without Visual Studio being able to create the OCX, you won't be able to run Dependency Walker on the OCX. So you'll never figure out that the missing DLL's are the problem.

If you know which DLL's need to be placed in the Debug folder, just place them there, and the error will disappear. If you don't know, and if your OCX didn't get created, then go to project settings > Linker > General > Register Output and set the value to "No". This will create your OCX for you, but won't go through the process of registering it, which is when it needs the dependent DLL's.

Once you double-click the OCX and Dependency Walker shows you the missing DLL's with yellow circle icons, just place those DLL's in the same folder as the OCX, and your program will work fine. It's that simple.

这篇关于解决错误MSB8011:无法注册输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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