调试应用程序时发生了一些错误 [英] Some error occured when debuging applcation

查看:116
本文介绍了调试应用程序时发生了一些错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下错误

我无法查看设计师表格

Error as below

I can''t view the designer form

<small>Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)) <br />
Hide     <br />
<br />
at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)<br />
at System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid)<br />
at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)<br />
at System.Windows.Forms.AxHost.CreateInstance()<br />
at System.Windows.Forms.AxHost.GetOcxCreate()<br />
at System.Windows.Forms.AxHost.set_Site(ISite value)<br />
at System.ComponentModel.Container.Add(IComponent component, String name)<br />
at System.ComponentModel.Design.DesignerHost.Add(IComponent component, String name)<br />
at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name)<br />
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)<br />
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)<br />
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeInstance(IDesignerSerializationManager manager, Type type, Object[] parameters, String name, Boolean addToContainer)<br />
at System.ComponentModel.Design.Serialization.ComponentCodeDomSerializer.DeserializeInstance(IDesignerSerializationManager manager, Type type, Object[] parameters, String name, Boolean addToContainer)<br />
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)<br />
at System.ComponentModel.Design.Serialization.CodeDomSerializer.DeserializeStatementToInstance(IDesignerSerializationManager manager, CodeStatement statement)<br />
at System.ComponentModel.Design.Serialization.CodeDomSerializer.Deserialize(IDesignerSerializationManager manager, Object codeObject)<br />
at System.Windows.Forms.Design.ControlCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, Object codeObject)<br />
at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.DeserializeName(IDesignerSerializationManager manager, String name, CodeStatementCollection statements)</small>

推荐答案

我猜测您的默认构造函数中有某些设计人员无法处理的内容.

创建您的应用程序调用的重载构造函数,或者将现有构造函数中的有害代码放入如果在设计器中打开了表单则不执行的块中.

It''s my guess that you have something in the default constructor that the designer can''t cope with.

Create an overloaded constructor that your application calls, or put the offending code in the existing constructor into a block that that doesn''t execute if the form is opened in the designer.

public sub New()
    InitializeComponents()
    if (not this.DesignMode) then
        '' your code goes here
    endif
end sub


这篇关于调试应用程序时发生了一些错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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