调用堆栈错误 - C#

发布于 2024-12-17 02:06:58 字数 2457 浏览 0 评论 0原文

        // 
        // textEdit1
        // 
        this.textEdit1.Location = new System.Drawing.Point(4, 20);
        this.textEdit1.Name = "textEdit1";
        this.textEdit1.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.HotFlat;
        this.textEdit1.Properties.MaxLength = 15;
        this.textEdit1.Properties.NullValuePrompt = "<Beta Code>";
        this.textEdit1.Properties.NullValuePromptShowForEmptyValue = true;
        this.textEdit1.Properties.PasswordChar = '*';
        this.textEdit1.Size = new System.Drawing.Size(250, 22);
        this.textEdit1.TabIndex = 2;

因此,我收到 5 条警告消息和一个调用堆栈错误,这意味着我无法在设计器模式下查看它。

警告消息:

Warning 1   Object reference not set to an instance of an object.
Warning 2   Object reference not set to an instance of an object.
Warning 3   Object reference not set to an instance of an object.
Warning 4   Object reference not set to an instance of an object.
Warning 5   Object reference not set to an instance of an object.

他将不胜感激任何帮助。提前致谢。

调用堆栈:

at DevExpress.XtraEditors.Repository.RepositoryItem.CreateDesigner()
at DevExpress.XtraEditors.Repository.RepositoryItem.FilterProperties(PropertyDescriptorCollection collection)
at DevExpress.XtraEditors.Repository.RepositoryItem.System.ComponentModel.ICustomTypeDescriptor.GetProperties(Attribute[] attributes)
at System.ComponentModel.TypeDescriptor.MergedTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetProperties(Attribute[] attributes)
at System.ComponentModel.TypeDescriptor.GetPropertiesImpl(Object component, Attribute[] attributes, Boolean noCustomTypeDesc, Boolean noAttributes)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.GetPropertiesHelper(IDesignerSerializationManager manager, Object instance, Attribute[] attributes)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializePropertyAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement, CodePropertyReferenceExpression propertyReferenceEx, Boolean reportError)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)
        // 
        // textEdit1
        // 
        this.textEdit1.Location = new System.Drawing.Point(4, 20);
        this.textEdit1.Name = "textEdit1";
        this.textEdit1.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.HotFlat;
        this.textEdit1.Properties.MaxLength = 15;
        this.textEdit1.Properties.NullValuePrompt = "<Beta Code>";
        this.textEdit1.Properties.NullValuePromptShowForEmptyValue = true;
        this.textEdit1.Properties.PasswordChar = '*';
        this.textEdit1.Size = new System.Drawing.Size(250, 22);
        this.textEdit1.TabIndex = 2;

I get 5 warning messages and a call stack error because of this, meaning I can't view it in designer mode.

Warning Messages:

Warning 1   Object reference not set to an instance of an object.
Warning 2   Object reference not set to an instance of an object.
Warning 3   Object reference not set to an instance of an object.
Warning 4   Object reference not set to an instance of an object.
Warning 5   Object reference not set to an instance of an object.

Any help would he appreciated. Thanks in advance.

Call Stack:

at DevExpress.XtraEditors.Repository.RepositoryItem.CreateDesigner()
at DevExpress.XtraEditors.Repository.RepositoryItem.FilterProperties(PropertyDescriptorCollection collection)
at DevExpress.XtraEditors.Repository.RepositoryItem.System.ComponentModel.ICustomTypeDescriptor.GetProperties(Attribute[] attributes)
at System.ComponentModel.TypeDescriptor.MergedTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetProperties(Attribute[] attributes)
at System.ComponentModel.TypeDescriptor.GetPropertiesImpl(Object component, Attribute[] attributes, Boolean noCustomTypeDesc, Boolean noAttributes)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.GetPropertiesHelper(IDesignerSerializationManager manager, Object instance, Attribute[] attributes)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializePropertyAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement, CodePropertyReferenceExpression propertyReferenceEx, Boolean reportError)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夕色琉璃 2024-12-24 02:06:59

您只是忘记向其中一个对象提供数据。确保所有需要数据的源和对象都能获取数据。

首先使用 try 和 catch 省略一些代码,以查看错误的根源(如果可以通过检查调用堆栈来做到这一点)。

You simply have forgotten to feed one of your objects with data. Ensure that all sources and objects that require data do get it.

Begin by omitting some of your code with try and catch to see where the error got its origin if you can do that by checking the Call Stack.

吹梦到西洲 2024-12-24 02:06:59

我怀疑 TextEdit.Properties 对象没有根据生成的警告数量进行实例化(对 Properties 属性的 5 次引用产生 5 条警告)。快速谷歌搜索显示其他一些人在使用 DevExpress 控件时遇到了这个问题,尽管我找不到任何解决方案。

以下是您应该尝试的一些操作:

  1. 确保您已引用所有适用的 DevExpress DLL。
  2. 尝试从表单/控件/等中删除 TextEdit 控件,然后再次添加。
  3. 将您的问题提交至 DevExpress 支持中心。他们通常反应非常灵敏。

I suspect the TextEdit.Properties object isn't being instantiated based on the # of warnings being generated (5 warnings for 5 references to the Properties property). A quick Google search shows a few other people have had this problem with DevExpress controls though I can't find any resolution.

Here are a few things you should try:

  1. Make sure you have referenced all of the applicable DevExpress DLLs.
  2. Try removing your TextEdit control from the form/control/etc and add it again.
  3. Submit your issue to the DevExpress support center. They are usually very responsive.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文