BUG: "Sub Main was not found in WindowsApplication1.Form1" error message when you change the Name property of a Startup Form in Visual Basic .NET (317098)
The information in this article applies to:
- Microsoft Visual Basic .NET (2003)
- Microsoft Visual Basic .NET (2002)
This article was previously published under Q317098 SYMPTOMS If you change the Name property of a Startup Form in Visual Basic .NET, you may receive
the following error message when you run or build the project:
'Sub Main' was not found in 'WindowsApplication1.Form1'
The "WindowsApplication1.Form1" (without quotation marks) part of
the error message might be different depending on your project's root namespace
and the name of your Startup Form. CAUSE This problem can occur because the Startup Object property for the project is not updated to the new form name.
RESOLUTION To resolve this problem, change the Startup Object property for the project to the new form name. To do this:
- Right-click the Startup project in Solution Explorer.
- Click Properties when you receive the context menu.
The Property Pages dialog box appears. - Click the General node in the Common Properties node, if it is not already selected.
- Click the Startup Object drop-down list box.
- Select the new name for the Startup Object drop-down list box.
- Click OK.
NOTE: You can also open the Property Pages dialog box by clicking Properties on the Project menu, or by pressing the Shift+F4 keys. For this to work, the Startup project should be selected in the Solution Explorer. STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
Modification Type: | Minor | Last Reviewed: | 2/3/2006 |
---|
Keywords: | kbvs2005doesnotapply kbvs2005swept kbvs2002sp1sweep kbbug kberrmsg kbnofix KB317098 |
---|
|