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 probl开发者_运维问答em 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!
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.
精彩评论