【发布时间】:2012-01-03 05:46:43
【问题描述】:
//
// 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)
【问题讨论】:
-
this.textEdit1 存在吗?调用堆栈错误是什么?
-
@rlemon 我会把它添加到主帖中
-
@JohnSaunders 不,但感谢发帖。
-
@Neel:“不”什么?这不是 NullReferenceException?
标签: c# .net warnings compiler-warnings windows-forms-designer