title: C# Visual Studio Code: Building a Hello World executable
body: <p>I am attempting to build a simple hello world executable in Visual Studio Code and don't know what I am doing incorrect? and to explain I will go over my steps.</p>
  
  <p>To start I was following the simple tutorial here <a href="https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code" rel="noreferrer">https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code</a>  </p>
  
  <p>Once I got down to the bottom I thought I would take my C# project and compile(or build) the project. Well I guess they don't go over this near the beginning because it's not real straight forward.</p>
  
  <p>First of all I had to figure out that Visual Studio and Visual Studio Code do not share the same knowledgebase (at least when it comes to compiling).</p>
  
  <p>The next thing is that visual studio code uses Tasks to build the executable, well at least that is what I got from this <a href="https://stackoverflow.com/questions/35544588/how-do-you-compile-a-console-application-with-vs-code-windows-platform">How do you compile a console application with VS Code (Windows platform)?</a></p>
  
  <p>So what I did was</p>
  
  <p>Step 1) Create new folder in windows explorer where I wanted my project to reside<br>
  Step 2) Open up visual studio and using the terminal navigate to the folder<br>
  Step 3) Type the command >>dotnet new console<br>
  Step 4) Type the command >>dotnet restore<br>
  Step 5) Make sure my code looks like</p>
  
  <pre><code>using System; //The using keyword is used to include the system namespace in the program
  
  namespace HelloWorldApplication //A namespace is a collection of classes
  {
      class HelloWorld
  {
          static void Main(string[] args)
          {
              Console.WriteLine("Hello World!");
              Console.ReadKey();
         }
      }
  }
  </code></pre>
  
  <p>After that I pressed <strong>F1</strong> typed in "Run Build Task" </p>
  
  <p>A prompt asking me to create a build task where I selected .NET core creating a tasks.json file</p>
  
  <pre><code>{
  // See https://go.microsoft.com/fwlink/?LinkId=733558
  // for the documentation about the tasks.json format
  "version": "2.0.0",
  "tasks": [
      {
          "label": "build",
          "command": "dotnet build",
          "type": "shell",
          "group": "build",
          "presentation": {
              "reveal": "silent"
          },
          "problemMatcher": "$msCompile"
      }
  ]
  }
  </code></pre>
  
  <p>Now I press ctrl+shift+b select build and well nothing happens. </p>
  
  <p>I went down to the terminal and typed dotnet build and got the following terminal response</p>
  
  <pre><code>d:\VS_Sandbox\HelloWorldApplication&gt;dotnet build
  Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
  Copyright (C) Microsoft Corporation. All rights reserved.
  
    Restoring packages for d:\VS_Sandbox\HelloWorldApplication\HelloWorldApplication.csproj...
    Generating MSBuild file d:\VS_Sandbox\HelloWorldApplication\obj\HelloWorldApplication.csproj.nuget.g.props.
    Restore completed in 134.6 ms for d:\VS_Sandbox\HelloWorldApplication\HelloWorldApplication.csproj.
    HelloWorldApplication -&gt; d:\VS_Sandbox\HelloWorldApplication\bin\Debug\netcoreapp2.2\HelloWorldApplication.dll
  
  Build succeeded.
      0 Warning(s)
      0 Error(s)
  
  Time Elapsed 00:00:01.03
  </code></pre>
  
  <p>To which I go and look for my brand new executable and well nothing? I attempted to go take a look at the help on microsoft here <a href="https://code.visualstudio.com/docs/editor/tasks" rel="noreferrer">https://code.visualstudio.com/docs/editor/tasks</a></p>
  
  <p>but thought I was going to find how to use csc.exe in my tasks but I don't know how and I am not even sure I am supposed too? </p>
  
  <p>If anyone knows what I am doing wrong please let me know.</p>