【发布时间】:2011-01-04 07:48:23
【问题描述】:
我有一个 winforms 项目,我在程序集 A 上创建了一个继承自 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();
}
}
}
现在,当我在从我的 DataForm 继承的程序集 B 上创建表单时,设计器不会加载,但如果我编译它,应用程序运行良好。
表格如下:
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)
这是设计师的错误吗?,我做错了吗?有什么解决办法吗?
感谢您的帮助
【问题讨论】:
标签: winforms visual-studio-2008 designer