title: Is it possible to compile a single C# code file with the .NET Core Roslyn compiler?
body: <p>In old .NET we used to be able to run the <code>csc</code> compiler to compile a single .cs file or several files.</p>
  
  <p>With .NET Core we have <code>dotnet build</code> that insists on having a proper project file. Is there a stand-alone  command line compiler that would allow to compile source code files without having a project (and listing referenced dependencies on the same command line)?</p>
  
  <p>On Linux, when I have the old <code>csc</code> and the new .NET Core installed, I get these timings:</p>
  
  <pre><code>[root@li1742-80 test]# time dotnet build
  Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core
  Copyright (C) Microsoft Corporation. All rights reserved.
  
    test -&gt; /root/test/bin/Debug/netcoreapp2.0/test.dll
  
  Build succeeded.
      0 Warning(s)
      0 Error(s)
  
  Time Elapsed 00:00:03.94
  
  real    0m7.027s
  user    0m5.714s
  sys     0m0.838s
  
  [root@li1742-80 test]# time csc Program.cs
  Microsoft (R) Visual C# Compiler version 2.3.0.61801 (3722bb71)
  Copyright (C) Microsoft Corporation. All rights reserved.
  
  
  real    0m0.613s
  user    0m0.522s
  sys     0m0.071s
  [root@li1742-80 test]#
  </code></pre>
  
  <p>Note 7 seconds with .NET Core versus several hundred milliseconds with the old <code>csc</code> for the same file, <code>Program.cs</code>.</p>
  
  <p>I'd like to be able to compile as fast with .NET Core as I used to be able with <code>csc</code>.</p>