VB.NET

Moderators: seancampbell
Number of threads: 4022
Number of posts: 10035

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Error 1'Sub Main' was not found in 'MyHelloWorldApplication.Module1'. Posted by rdongol on 4 Jun 2008 at 4:29 AM
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

Report
Re: Error 1'Sub Main' was not found in 'MyHelloWorldApplication.Module Posted by seancampbell on 4 Jun 2008 at 5:44 AM
Try:

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


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
Report
Re: Error 1'Sub Main' was not found in Posted by theboyholty on 7 Nov 2008 at 5:46 AM
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.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.