mscorlib.dll中发生类型为'System.Runtime.InteropServices.COMException'的第一次机会异常 [英] A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

查看:113
本文介绍了mscorlib.dll中发生类型为'System.Runtime.InteropServices.COMException'的第一次机会异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

专家

我在运行控制台应用程序时发现了错误.下面给出的错误.

i am find the error while run the console application. the error given below.

我的错误出现在代码的第一行,即   DFCLib.IDfClientX cx = new DFCLib.DfClientX();  代码如下:

My error is comes on the first line of the code i.e.   DFCLib.IDfClientX cx = new DFCLib.DfClientX();  the code is given below

推荐答案

Shishusingh,

Hi shishusingh,

感谢您的信息.

>>>>>未注册的类(HRESULT的异常:0x80040154(REGDB_E_CLASSNOTREG)."

>>"Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))."

根据您的描述,您正在使用COM组件,并且在使用COM组件之前未对其进行注册.

Based on your description, you were using a COM component and the COM component is not registered before you were using it.

Windows提供了RegSvr32.exe,可以注册COM组件. RegSvr32.exe具有以下命令行选项:

Windows provides RegSvr32.exe which could register COM component. RegSvr32.exe has the following command-line options:

Regsvr32 [/u] [/n] [/i[:cmdline]] <dllname>

/u - Unregister server 
/i - Call DllInstall passing it an optional [cmdline]; when it is used with /u, it calls dll uninstall 
/n - do not call DllRegisterServer; this option must be used with /i 
/s – Silent; display no message boxes

请在使用前注册您的COM组件.有关更多信息,请参见下面的链接.

Please register your COM component before using it. For more information, link below is for your reference.

如何使用Regsvr32工具并对Regsvr32错误消息进行故障排除

How to use the Regsvr32 tool and troubleshoot Regsvr32 error messages

最好的问候,
王丽

Best Regards,
Li Wang


这篇关于mscorlib.dll中发生类型为'System.Runtime.InteropServices.COMException'的第一次机会异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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