gpt4 book ai didi

VB.NET 设计器错误 : How to (correctly) inherit form that inherits form?

转载 作者:行者123 更新时间:2023-12-04 20:02:31 27 4
gpt4 key购买 nike

我想做个模板Class BaseDialog ,但在进行最终对话时 MyDialog1 , 继承了 BaseDialog , 我收到错误,然后无法在设计模式下显示对话框。
以下是我得到的错误列表。

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 无法为此文件显示设计器,因为无法设计其中的任何类。设计者检查了文件中的以下类:
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.

关于VB.NET 设计器错误 : How to (correctly) inherit form that inherits form?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28286269/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com