'Sub Main' was not found ....

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I'm new with vb.net
I've got application of single form 2 buttons and text field
When I try to run my progra
I get the following messag
'Sub Main' was not found in 'LoanCalculator.Form1'

Where should I put Sub main and what should it contain

Thank you in advance
Pavel
 
* "=?Utf-8?B?UGF2ZWw=?= said:
I'm new with vb.net.
I've got application of single form 2 buttons and text field.
When I try to run my program
I get the following message
'Sub Main' was not found in 'LoanCalculator.Form1'.

Where should I put Sub main and what should it contain.

Should work. Is it a 'Public Shared Sub Main'? You can select the
startup object in the project properties.
 
Pavel,
In addition to Herfried's comments:

What is the name of your form? It sounds like you renamed your form from
Form1 to LoanForm, CalculatorForm, frmLoan, or something else...

Use the Projects - Property Pages to select your Startup object, your only
form.

To get to the Projects - Property Pages, right click on the Project in
Solution Explorer and select Properties.

Hope this helps
Jay
 
LoanCalculator? Pavel? ...Hartford based company employee?

If so, it's me, Scott M!

You probably changed the default form (form1) name to something more
appropriate. But when you did that, VS.NET still wanted to use Form1 as the
project's startup object and couldn't find it. It then went looking for the
next best thing, a Sub called "Main" (which is a kind of default sub), which
you don't have either and thus you get the error.

When VS.NET indicates that "There were build errors. Do you want to
continue?", choose "No" and then you will have a Task window appear. Double
click on the task about the error and a small dialog will come up asking you
what the project should start with. Your correctly named form will be
listed, just choose it and you are all set.

You can also, right click on the project name in the Solution Explorer and
choose properties. You can set the project's start up object there as well.
 
Back
Top