Select the HelloWorld button or press Ctrl+ F5 to run the default "HelloWorld" code in Debug mode. The Program.vb file contains default code that calls the WriteLine method to display the literal string "Hello World!" in the console window. Now your application runs in the console and remains open until you press any key to close the console window.Īfter you select your Visual Basic project template and name your project, Visual Studio creates a simple "Hello World!" application for you. Navigate to the HelloWorld.exe file in the bin > Debug > net6.0 folder, and run it. Then, select Open Folder in File Explorer. In Solution Explorer, right-click on HelloWorld to open the context menu for your project. This compiles your program into an intermediate language (IL) that's converted into binary code by a just-in-time (JIT) compiler. On the menu bar, select Build > Build Solution. This pauses the program until you press a key. Let's add some code to pause the application and then ask for user input.Īdd the following code immediately after the call to the WriteLine method: Console.Write("Press any key to continue.") However, if you navigate to HelloWorld.exe in File Explorer and run it, the Main procedure terminates after its single statement executes and the console window closes quickly. When the application runs in the Microsoft Visual Studio Debug Console, the console window remains open until you press a key. If you select the HelloWorld button in the IDE, you can run the program in Debug mode.
It calls the WriteLine method to display the literal string "Hello World!" in the console window. After you select your Visual Basic project template and name your project, Visual Studio creates a simple "Hello World" application for you.