我有一个WinForms项目,并在程序集上创建了一个类
一
继承自
System.Windows.Forms.Form
为了在我的项目中作为各种表单的基类,基类类似于:
public partial class DataForm<T> : Form where T : class
{
T currentRecord;
protected T CurrentRecord
{
get
{
return currentRecord;
}
set
{
currentRecord = value;
CurrentRecordChanged();
}
}
}
现在,当我在程序集上创建窗体时
乙
它继承了我的数据表单,设计师不会加载,但如果我编译它,应用程序运行良好。
表单如下:
public partial class SomeTableWindow : DataForm<SomeTable>
{
public SomeTableWindow ()
{
InitializeComponent();
}
}
我得到的错误是:
The designer could not be shown for this file because none of the classes within it can be designed.
The designer inspected the following classes in the file: CultivosWindow --- The base
class 'TripleH.Erp.Controls.DataForm' could not be loaded. Ensure the assembly has
been referenced and that all projects have been built.
Instances of this error (1)
1. Hide Call Stack
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager manager)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)
这是设计师的错误吗?我做错什么了吗?有什么解决办法吗?
谢谢你的帮助