无法启动 WinForms 项目,因为 Form 是一种类型
我有一个非常小的 VS2008 Winforms 项目,无法启动。
当我尝试开始调试项目时,我收到消息:
'<form>' is a type in '<project>' and cannot be used in an expression.
来自文件 .Designer.vb。
问题是这确实是一种形式。如果我创建一个新的 WinForm 并将启动对象设置为新表单,我会收到相同的消息。
当我尝试检查项目属性中的“启用应用程序框架”复选框时,收到消息“选中‘启用应用程序框架’时,启动对象必须是一个表单。
我尝试创建一个新项目并移动所有代码设计师反对新项目中的新表单文件,
同一台计算机上的其他项目运行良好,
有什么建议吗
?
I have a very small VS2008 Winforms project that will not start.
When I attempt to start debugging the project, I get the message:
'<form>' is a type in '<project>' and cannot be used in an expression.
From the file .Designer.vb.
The problem is that is indeed a form. If I create a new WinForm and set the startup object to the new form, I get the same message.
When I attempt to check the "Enable application framework" checkbox in the Project properties, I get the message "Startup object must be a form when 'Enable application framework' is checked.
I've tried creating a new project and moving all the code and designer objects to a new form file in the new project, and same result.
Other projects on the same computer run fine.
Any suggestions?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,问题是我没有不带参数的New()函数。这是 VS 将类视为表单所必需的。
Turns out that the problem was that I didn't have a New() function with no parameters. This is required for VS to see the class as a form.