Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
| Search | Today's Posts | Mark Forums Read
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 29th, 2005, 01:18 AM
Registered User
 
Join Date: May 2005
Location: , , .
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default "'Sub Main' was not found" on new project.

I'm trying to create an application using an existing form from another application. I deleted the default Form1 from the Solution Explorer, went into the project properties and changed my startup object to the new form. However, when I try to compile the program, I still get the "'Sub Main' was not found" error. Any suggestions? This is starting to drive me crazy. I really don't want to have to copy/paste the old form or re-code it.

Thanks in advance.

 
Old November 1st, 2005, 07:01 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Hudson, MA, USA.
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

Check the project's properties/Common properties/General/Startup object dropdown and make sure it does not refer to "Sub Main", but instead refers to the form you want to start with.

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
 
Old November 2nd, 2005, 02:12 AM
Registered User
 
Join Date: May 2005
Location: , , .
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Already done that. What's wierd is that if I recreate form1, then it works just fine.

At the moment, I have a workaround that is acceptable, so now I'm just curious why this would be doing this.

 
Old November 5th, 2005, 11:51 PM
Registered User
 
Join Date: Nov 2005
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

1) Click on "Solution Explorer" tab
2) Right Click on project file icon, in this example "Exercise1"
3) Select "Properties" on the very bottom of pop up menu
4) Select "frmExercise1" as in this example in "start up Object" drop down box and click 'Ok'

Hope that helped


 
Old November 7th, 2005, 12:24 AM
Registered User
 
Join Date: May 2005
Location: , , .
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I have already set the new form to the startup object of the project. Same error message.

 
Old December 1st, 2005, 08:42 AM
Registered User
 
Join Date: May 2005
Location: , , .
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Same error message, new issue. When I create a new project and run a blank form1, everything works fine. When I do a Copy/Paste from an existing form into Form1 and try to run it, I get the same error message. I'm not adding any code with the exception of collection info for a drop-down box. The solution properties show form1 as the startup object. I can create a button on form1 to run a separate instance of the form I want to create, but that's not the object of the program.

I'm also getting the problem when I create all the controls manually. For whatever reason, it seems that Visual Studio doesn't like the way I've written my code? MSDN says that Main should be created automatically. I don't know if I'm missing another option or what.

Any help? It would greatly appreciated.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Website project vs Web Application Project... thenoseknows ASP.NET 2.0 Professional 0 January 14th, 2007 09:47 PM
C++ and main for a beginner fords4me78 C++ Programming 2 February 27th, 2006 09:32 PM
Add report of one project into another project tejaswibv Crystal Reports 0 July 13th, 2005 04:40 AM
project or library not found error KenK Access VBA 5 February 4th, 2005 01:01 PM
To Imar: Re: Sub Main shadowpug VB.NET 2002/2003 Basics 1 July 26th, 2003 02:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.