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

Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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

rdongolrdongol Posts: 1Member
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, USAPosts: 684Member ✭✭✭
    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
  • theboyholtytheboyholty Posts: 1Member
    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.