问题描述
- c#winform运行时报如下错误1
-
程序加入指纹识别功能(中控5.0),但是在未安装驱动的机器上运行就会出现以下错误,在不安装驱动的情况下怎么解决啊?求大神支招。
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.************** Exception Text **************
System.Runtime.InteropServices.COMException (0x80040154): 没有注册类别 (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
at System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid)
at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)
at System.Windows.Forms.AxHost.CreateInstance()
at System.Windows.Forms.AxHost.GetOcxCreate()
at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
at System.Windows.Forms.AxHost.CreateHandle()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.AxHost.EndInit()
at tc_gcm.UI.FrontControl.UcMembershipCard.InitializeComponent() in E:2015-09-25-2256办卡刷卡指纹事件优化 c.gcm c_gcm.UIFrontControlUcMembershipCard.Designer.cs:line 1343
at tc_gcm.UI.FrontControl.UcMembershipCard..ctor() in E:2015-09-25-2256办卡刷卡指纹事件优化 c.gcm c_gcm.UIFrontControlUcMembershipCard.cs:line 27
at tc_gcm.UI.FrontControl.ucmenbercontrol.InitializeComponent() in E:2015-09-25-2256办卡刷卡指纹事件优化 c.gcm c_gcm.UIFrontControlucmenbercontrol.Designer.cs:line 36
at tc_gcm.UI.FrontControl.ucmenbercontrol..ctor() in E:2015-09-25-2256办卡刷卡指纹事件优化 c.gcm c_gcm.UIFrontControlucmenbercontrol.cs:line 17
at tc_gcm.UI.FrontControl.frontList.InitializeComponent() in E:2015-09-25-2256办卡刷卡指纹事件优化 c.gcm c_gcm.UIFrontControlfrontList.Designer.cs:line 43
at tc_gcm.UI.FrontControl.frontList..ctor() in E:2015-09-25-2256办卡刷卡指纹事件优化 c.gcm c_gcm.UIFrontControlfrontList.cs:line 19
at tc_gcm.UI.MainForm.InitializeComponent() in E:2015-09-25-2256办卡刷卡指纹事件优化 c.gcm c_gcm.UIMainForm.Designer.cs:line 65
at tc_gcm.UI.MainForm..ctor() in E:2015-09-25-2256办卡刷卡指纹事件优化 c.gcm c_gcm.UIMainForm.cs:line 41
at tc_gcm.UI.Loginfrom.btnlogin_Click(Object sender, EventArgs e) in E:2015-09-25-2256办卡刷卡指纹事件优化 c.gcm c_gcm.UILoginfrom.cs:line 165
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.PerformClick()
at System.Windows.Forms.Form.ProcessDialogKey(Keys keyData)
at System.Windows.Forms.TextBoxBase.ProcessDialogKey(Keys keyData)
at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
Gym
Assembly Version: 1.5.9.22
Win32 Version: 1.5.9.22CodeBase: file:///D:/Debug/Gym.exe
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRelCodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRelCodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRelCodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
tc_gcm.Dog
Assembly Version: 1.5.7.23
Win32 Version: 1.5.7.23CodeBase: file:///D:/Debug/tc_gcm.Dog.DLL
tc_gcm.keys
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0CodeBase: file:///D:/Debug/tc_gcm.keys.DLL
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRelCodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRelCodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
tc_gcm.BLL
Assembly Version: 1.5.7.23
Win32 Version: 1.5.7.23CodeBase: file:///D:/Debug/tc_gcm.BLL.DLL
tc_gcm.Models
Assembly Version: 1.5.7.23
Win32 Version: 1.5.7.23CodeBase: file:///D:/Debug/tc_gcm.Models.DLL
tc_gcm.DAL
Assembly Version: 1.5.7.23
Win32 Version: 1.5.7.23CodeBase: file:///D:/Debug/tc_gcm.DAL.DLL
System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
System.EnterpriseServices
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRelCodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
System.Management
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
tc_gcm.ColorPicker
Assembly Version: 1.5.7.23
Win32 Version: 1.5.7.23CodeBase: file:///D:/Debug/tc_gcm.ColorPicker.DLL
System.Windows.Forms.DataVisualization
Assembly Version: 3.5.0.0
Win32 Version: 3.5.30729.5681CodeBase: file:///D:/Debug/System.Windows.Forms.DataVisualization.DLL
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRelCodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
AForge.Controls
Assembly Version: 2.2.3.0
Win32 Version: 2.2.3.0CodeBase: file:///D:/Debug/AForge.Controls.DLL
AxInterop.ZKFPEngXControl
Assembly Version: 3.8.0.0
Win32 Version: 3.8.0.0CodeBase: file:///D:/Debug/AxInterop.ZKFPEngXControl.DLL
AForge.Video
Assembly Version: 2.2.3.0
Win32 Version: 2.2.3.0CodeBase: file:///D:/Debug/AForge.Video.DLL
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.For example:
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
解决方案
com控件没有注册。你需要先注册控件。
如果你希望程序在没有这个控件的情况下也能运行,就在tc_gcm.UI.FrontControl.UcMembershipCard.InitializeComponent() 里面找到相关控件的初始化代码,剪切拷贝到构造函数中,用try catch包裹。
解决方案二:
DB2运行时报的错误
C# WinForm 开机自动运行
C# WinForm 开机自动运行