ClassFactory 无法提供请求的类 0x80040111 错误:-2147221231
使用 Visual Studio 2008 时,我第一次遇到这种情况是在 Visual Basic 中尝试打开标准保存文件对话框时。 到目前为止,我在无果搜索后已经解决了这个问题。 现在我发现任何会导致保存/打开对话框的操作(例如 ctrl-O)也会失败。 我已经搜索了更多,但仍然不知道如何解决它。
我所知道的事情: 这不是 Visual Studio 错误,它显然可能发生在任意数量的其他应用程序中(这就是为什么搜索它很烦人)
它与 .NET 或 COM 相关,我尝试重新安装所有 .NET,但没有成功,我已经我从来没有接触过COM,我什至不知道它是什么。
某些内容丢失、放错位置,或者可能是 DLL 版本问题。
我真的不想卸载 VS2008、MS Office(我发现建议的结果之一)或任何其他大型应用程序。
Using Visual Studio 2008 I first encountered this when trying to open a standard save file dialog box in visual basic. So far I've worked around it after fruitless searching. Now I find that any action which would cause a save/open dialog (eg. ctrl-O) also fails. I've searched more and still don't know how to fix it.
Stuff I do know:
It's not a Visual Studio error, it apparently can occur in any number of other applications (which is why searching for it is annoying)
It's either .NET or COM related, I tried reinstalling all of .NET with no luck, and I've never mucked around with COM ever, I don't really even know what it is.
Something is missing, misplaced, or it could be DLL version issues.
I really don't want to deal with uninstalling VS2008, or MS Office (as one result I found suggested) or any other big application.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这里的根本问题是 CoCreateInstance 失败。 如果不附加调试器并中断 CoCreateInstance,将很难找出问题所在。 即使您花时间执行此操作,也不太可能修复错误。
我同意重新安装是最后的手段。 但中间步骤是尝试修复安装。 如果重新插入 VS 安装盘,选项之一将是“修复”安装。 您可能需要通过“添加/删除程序”才能获得此选项。
修复比卸载/重新安装要快得多,并且很可能会解决此特定问题。
编辑
OP报告修复成功,但没有修复错误。 您能否检查事件日志并查看是否会为此故障生成更具体的错误?
The underlying problem here is that a CoCreateInstance is failing. Without attaching a debugger and breaking in CoCreateInstance it's going to be fairly difficult to track down what the problem is. And even if you spend the time to do this, it's unlikely that you'll be able to fix the error.
I agree that a re-install is a last resort. But an in-between step is to attempt to repair the install. If you re-insert the VS Setup Disk, one of the options will be to "Repair" the installation. You may have to go through Add/Remove Programs to get this option.
A Repair is much faster than uninstall/reinstall and will very likely fix this particular issue.
EDIT
OP reported repair succeeded but did not fix the error. Can you check the event log and see if a more specific error is being generated for this failure?
因此,某人在某个地方尝试共同创建一些它(认为)需要完成其工作的对象。 这可能是也可能不是 Visual Studio 对象。 由于它出现在“保存/打开”对话框中,因此它很可能是一个 shell 对象。
最可能的解释是该对象的注册表项已以某种方式损坏,或者导出该对象的 dll 以某种方式损坏。 对于后者,它可能会完全丢失,或者由于某种原因而处于不良状态。
您可以尝试做的一件事是在可能的候选 DLL 上运行 regsvr32,但这只是在黑暗中进行。
另一个更高级的选项是将调试器(例如 ntsd 或 Windbg)附加到 Visual Studio 进程本身,并在系统 dll 中的 CoCreateInstance() 上设置断点(确保在头文件中查找其确切签名 -它可能被#定义为其他东西)。 然后获取作为参数传递给 CoCreateInstance() 的对象的 GUID。 在您的注册表(或没有此问题的朋友注册表)中查找此内容应该可以让您很好地了解需要处理哪些 DLL。
So, somebody, somewhere is trying to CoCreate some object that it (thinks) it needs to do its job. This may or may not be a Visual Studio object. Since it manifests in the Save / Open dialog it could very well be a shell object.
The most likely explanation is the registry entry for the object has been corrupted in some way, or the dll that exports the object is corrupted in some way. For the latter it could be missing completely, or just in a bad state for some reason.
One thing you can try doing is running regsvr32 on likely candidate DLLs, but that's just shooting in the dark.
Another, more advanced option is to attach a debugger (such as ntsd or windbg) to the Visual Studio process it self and set a breakpoint on CoCreateInstance() in the system dll (make sure to look up its exact signature in the header file—it may be #defined to something else). Then get the GUID for the object that it is passing as the argument to CoCreateInstance(). Looking this up in your registry (or a friends registry that doesn't have this issue) should give you a good idea of what DLL you need to go mess with.
我在 VS 2008 中也遇到过类似的问题,幸运的是,它通过以下解决方案得到了解决。 尝试这个!!
找到 devenv.exe。
右键单击>属性> 取消选中禁用视觉主题选项
I've faced similar issue with VS 2008 and luckily it got solved with the below solution. Try this!!
Locate devenv.exe.
Right click >Properties > Uncheck Disable Visual Themes Option
取消选中
禁用视觉主题
对我来说不起作用,但在 xp 兼容模式下运行修复了它。 我假设问题是缺少 dll。Unchecking
Disable Visual Themes
didn't work for me, but running in xp compatibility mode fixed it. I'm assuming the problem is a missing dll.