title: Deploying C# Program as a Command Line Utility
body: <p>I wrote a pretty simple program in C# to automatically generate csv files of a specific format from data from other spreadsheets, and I'd like to deploy it as a command line interface utility, i.e a <code>.exe</code> file that can be run outside of VS Code, the IDE I'm using. I have the dotnet sdk tools installed, and I tried using <code>dotnet msbuild</code> with the .csproj file below:</p>
  
  <pre><code>&lt;Project Sdk="Microsoft.NET.Sdk"&gt;
  
    &lt;PropertyGroup&gt;
      &lt;OutputType&gt;Exe&lt;/OutputType&gt;
      &lt;Configuration&gt;Release&lt;/Configuration&gt;
      &lt;RuntimeIdentifiers&gt;win10-x64&lt;/RuntimeIdentifiers&gt;
      &lt;OutputType&gt;Exe&lt;/OutputType&gt;
      &lt;TargetFramework&gt;netcoreapp2.1&lt;/TargetFramework&gt;
    &lt;/PropertyGroup&gt;
  
  &lt;/Project&gt;
  </code></pre>
  
  <p>The command <code>dotnet msbuild</code> in the terminal built into VS Code generates a folder in <code>bin</code> called <code>release</code> that contains a <code>.dll</code> file, but not a <code>.exe</code> file. What parameters can I add to <code>dotnet msbuild</code> to generate a <code>.exe</code> file, or do I have to use another tool?</p>
  
  <p>EDIT: I checked <a href="https://stackoverflow.com/questions/44074121/build-net-core-console-application-to-output-an-exe">Build .NET Core console application to output an EXE?</a> </p>
  
  <p>and tried <code>dotnet publish -c Release -r win10-x64</code> and got this error: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.</p>
  
  <p>SOLUTION: msbuild was the wrong tool to use-- I believe csc is the correct tool, as it created an application file.</p>