Error 1'Sub Main' was not found in 'MyHelloWorldApplication.Module1'.

I am on lession 2.. how to solve this error. it comes while ctrl+f5 (compile and execute)

following code

Module MyHelloWorldApplication
Sub Main()
Console.WriteLine("Hello World")
End Sub
End Module

Comments

  • seancampbellseancampbell Pennsylvania, USA
    Try:

    [Code]
    Public Module HelloWorldMod
    Public Sub Main()
    Console.WriteLine("Hello World")
    End Sub
    End Module
    [/Code]

    Without the publics it worked for me, but I am using .Net 1.1 In .Net 2.0 it complains about calling subroutines that are not tagged with Public (in turn forcing us to write better code, go figure).

    Happy coding,
    Firesickle.com
  • Yeah I had the same issue. Its not much of a tutorial is it if the very first exersize doesn't work. I think i'll choose to learn VB.net elsewhere.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories