title: 'dotnet build' specify main method
body: <p>I am using <code>dotnet</code> to build a .NET Core C# project from the command line. The project has multiple classes with a <code>main</code> method. Thus I get the error:</p>
  
  <pre><code>$ dotnet build
  Microsoft (R) Build Engine version 15.1.548.43366
  Copyright (C) Microsoft Corporation. All rights reserved.
  
  Test.cs(18,28): error CS0017: Program has more than one entry point defined. Compile with /main to specify the type that contains the entry point.
  
  Build FAILED.
  </code></pre>
  
  <p>Passing the <code>/main</code> switch results in the error:</p>
  
  <pre><code>$ dotnet build /main:Test
  Microsoft (R) Build Engine version 15.1.548.43366
  Copyright (C) Microsoft Corporation. All rights reserved.
  
  MSBUILD : error MSB1001: Unknown switch.
  Switch: /main:Test
  </code></pre>
  
  <p>How can I pass the <code>/main</code> switch to the <code>dotnet</code> command?</p>