473,287 Members | 1,447 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 473,287 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 3326

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: I´ve 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: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.