title: How do I build a hello-world console app to run on the .NET CoreCLR?
body: <p>I'd like to run a hello-world console app using the .NET CoreCLR.</p>
  
  <p>So far, my code is as follows.</p>
  
  <pre><code>// Program.cs
  
  using System;
  
  namespace Study
  {
      public class Program
      {
          public void Main()
          {
              Console.WriteLine("Hello world!");
          }
      }
  }
  </code></pre>
  
  <p>&nbsp;</p>
  
  <pre><code>// project.json
  
  {
    "frameworks": {
      "dnxcore50": { }
    }
  }
  </code></pre>
  
  <p>I'm attempting to run this project using the commands:</p>
  
  <pre><code>dnvm use 1.0.0-beta8 -r coreclr
  dnx run
  </code></pre>
  
  <p>However this yields the following error:</p>
  
  <pre><code>Microsoft.Dnx.Compilation.CSharp.RoslynCompilationException: warning CS8021: No value for RuntimeMetadataVersion found. No assembly containing System.Object was found nor was a value for RuntimeMetadataVersion specified through options.
  (1,11): DNXCore,Version=v5.0 error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
  (2,11): DNXCore,Version=v5.0 error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
  (3,11): DNXCore,Version=v5.0 error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
  (1,58): DNXCore,Version=v5.0 error CS0518: Predefined type 'System.String' is not defined or imported
  (2,54): DNXCore,Version=v5.0 error CS0518: Predefined type 'System.String' is not defined or imported
  (3,67): DNXCore,Version=v5.0 error CS0518: Predefined type 'System.String' is not defined or imported
  d:\rp\study\004dnxCoreHelloWorld\Program.cs(1,7): DNXCore,Version=v5.0 error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
  d:\rp\study\004dnxCoreHelloWorld\Program.cs(5,18): DNXCore,Version=v5.0 error CS0518: Predefined type 'System.Object' is not defined or imported
  d:\rp\study\004dnxCoreHelloWorld\Program.cs(7,16): DNXCore,Version=v5.0 error CS0518: Predefined type 'System.Void' is not defined or imported
  d:\rp\study\004dnxCoreHelloWorld\Program.cs(9,31): DNXCore,Version=v5.0 error CS0518: Predefined type 'System.String' is not defined or imported
  d:\rp\study\004dnxCoreHelloWorld\Program.cs(9,13): DNXCore,Version=v5.0 error CS0518: Predefined type 'System.Object' is not defined or imported
  d:\rp\study\004dnxCoreHelloWorld\Program.cs(9,13): DNXCore,Version=v5.0 error CS0103: The name 'Console' does not exist in the current context
  d:\rp\study\004dnxCoreHelloWorld\Program.cs(5,18): DNXCore,Version=v5.0 error CS1729: 'object' does not contain a constructor that takes 0 arguments
     at Microsoft.Dnx.Compilation.CSharp.RoslynProjectReference.Load(AssemblyName assemblyName, IAssemblyLoadContext loadContext)
  
  ...et cetera...
  </code></pre>