472,993 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 472,993 developers and data experts.

sub main was not found - solution for complete noobs

I downloaded VB.NET for the first time and chose to start a project based on Windows Forms for VB.
It opened a new project with a default Form1 for me. I tried to run it expecting to see a blank form show but instead I got the rror message "sub main was not found".
After searching wrong answers for ages I found out that it's due to 2 set up errors by Microsoft (surprise, surprise).
The first error is that when you click the green arrow to Run your project, THE DEFAULT thing to run is a Subroutine called Main. If that isn't found, it doesn't say, "I don't know what to run".
The second error is that it does not specify that the Form is the default thing to run.
To fix that you need to right-click your Solution (Project) and choose Properties.
In the new window that opens, click Application, then the listbox Startup Object and click your form name e.g. Form1
Now it will work.

May 11 '21 #1
0 3254

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Sven Putze | last post by:
my target: I want to upload a file via HTTP Post and show the user a progress bar my 1st try: Ive used WebClient.UploadFile and WebClient.UploadData, they work fine but I don't know any...
4
by: james margey | last post by:
Hi to all, I have spent 3 days at this error and i have two days to go for a deadline, and i am about to go off my nut, the reason being: Microsoft dont seem to be able to provide a solution, I...
6
by: John Doe | last post by:
Hi, I've got the following error when building my ASP.NET application called WebApplication1: Preparing resources... Updating references... Performing main compilation... error CS0006:...
6
by: Benny Raymond | last post by:
I was trying to break some of my sections of code up into seperate files using the new "partial" type definition and coudln't figure out how to make the new files appear under the main file... ...
6
by: Joe Jax | last post by:
I have an object that spawns a worker thread to process one of its methods. That method processes methods on a collection of other objects. During this processing, a user may request to cancel the...
2
by: Erwin Moller | last post by:
Hi Group, I cannot log errors for some reason. Situation: PHP 5.0 ISAPI on W2000 IIS 5.0 In php.ini: error_reporting = E_ALL log_errors = On
2
by: Bill nguyen | last post by:
I converted a VB.NET 2003 app to 2005. I got error "SUB MAIN" not found. Why 05 requires a Sub Main to run? I never used Sub Main in my apps. Thanks Bill
1
by: Carl Dreher | last post by:
I need to detect when the user clicks on a column header to resort the data in a DataGrid. I've added an event handler to my class, which is a form that hold the DataGrid: Private Sub...
2
by: IGM | last post by:
Hi how do I maximize IE when I start web project from Visual Studio?
0
by: Gerrit Horeis | last post by:
I found a Reason for this solution This error occurs because of installation of a IIS update (windows update). After installing the update the settings from the root IIS application was copied to...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.