VB.NET Designer error: How to (correctly) inherit form that inherits form?

VB.NET Designer error: How to (correctly) inherit form that inherits form?

我想制作一种模板 Class BaseDialog,但是在制作继承 BaseDialog 的最终对话框 MyDialog1 时,出现错误,然后该对话框无法在设计中显示模式。 以下是我得到的错误列表。

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) 

还有: 警告 1 无法为该文件显示设计器,因为其中 类 的 none 可以设计。设计者检查了文件中的以下 类:

MyDialog1 --- The base class '[mynamespace].BaseDialog' could not be loaded.  Ensure the assembly has been referenced and that all projects have been built.

这里是我制作的 类 的例子(连同 .designer 文件,<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _Dispose 等,类)。

Public Class BaseDialog
Inherits System.Windows.Forms.Form
'
End Class

Public Class MyDialog1
Inherits BaseDialog
'
End Class

谁能告诉我我做错了什么?

已经解决。对不起! http://support.microsoft.com/kb/967050

原因

The Form Designer requires a compiled assembly in order to display an inherited form. If the base form class is contained within an assembly that was compiled using the x64 or Itanium options, they cannot be opened by the Form Designer. This is because Visual Studio is a 32-bit process, and cannot execute code in a 64-bit (x64 or Itanium) module.

分辨率

Make sure the base form(s) are defined in an assembly that is compiled using the "AnyCPU" build option. This allows form classes defined within the assembly to be used in either a 32-bit process (such as Visual Studio), or in a 64-bit custom process.