c# - 无法转换类型为“System.__ComObject”的 COM 对象

标签 c# visual-studio-2010 xna publishing

尝试在 Visual Studio 2010 中发布 XNA 项目时出现以下错误。

Error 1 Publish failed with the following error: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.OLE.Interop.IServiceProvider'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{6D5140C1-7436-11CE-8034-00AA006009FA}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). 1 1 Asteroids

我已经尝试按照其他人的建议注册 actxprxy.dllieproxy.dll,但我仍然收到此错误。

我在使用空白 XNA 游戏模板以及完成的 XNA 游戏时遇到此错误。

我能够很好地构建和调试相同的项目。

最佳答案

有一个discussion声称这是由于“注册表损坏”造成的。其中一条评论提出了一种“核心”解决方案,即在 System32 文件夹中重新注册每个 OCX 和 DLL:

for %1 in (%windir%\system32\*.dll) do regsvr32 /s %1
for %1 in (%windir%\system32\*.ocx) do regsvr32 /s %1

也许它可以解决您的问题。

关于c# - 无法转换类型为“System.__ComObject”的 COM 对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8694702/

相关文章:

c# - 我正在使用 mysql 存储过程。我的 SP 返回数据集,如何将值绑定(bind)到 Crystal 报表中

c# - Visual Studio 说名称在当前上下文中不存在

c# - 不能使用 FileFormatException (?)

c# - XNA 程序纹理

c# - 使用文本框更改控件

c# - 如何获得控件相对于其窗体位置的位置?

c# - 我如何在 .Net 中使用其他/更现代的模式验证?

c# - 如何选择整个 DataGrid 表格行并使用 WPF 单击按钮将其删除?

visual-studio-2010 - 在 Windows 7 中安装 Sharepoint Foundation 2010 时出现问题。错误 : "The language of this installation package is not supported by your system"

c# - 暂停线程直到手动恢复