3

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 .exe 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 dotnet msbuild with the .csproj file below:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <Configuration>Release</Configuration>
    <RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.1</TargetFramework>
  </PropertyGroup>

</Project>

The command dotnet msbuild in the terminal built into VS Code generates a folder in bin called release that contains a .dll file, but not a .exe file. What parameters can I add to dotnet msbuild to generate a .exe file, or do I have to use another tool?

EDIT: I checked Build .NET Core console application to output an EXE?

and tried dotnet publish -c Release -r win10-x64 and got this error: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

SOLUTION: msbuild was the wrong tool to use-- I believe csc is the correct tool, as it created an application file.

JackHannum
  • 39
  • 5
  • 1
    What is the question? Are you asking how to create an `exe` or how to make it available from any command line window, like `ping` utility? – Aleks Andreev Jun 14 '18 at 17:16
  • @AleksAndreev Both ideally – JackHannum Jun 14 '18 at 17:17
  • 2
    Possible duplicate of [Build .NET Core console application to output an EXE?](https://stackoverflow.com/questions/44074121/build-net-core-console-application-to-output-an-exe) – Broots Waymb Jun 14 '18 at 17:17
  • Core apps can be run with `dotnet [your_app].dll`. Otherwise you can go through a little extra work to get an .exe, but it's not typically necessary. – Broots Waymb Jun 14 '18 at 17:20
  • @BrootsWaymb I'm assuming the user won't have the dotnet sdk installed since I had to install it specifically to write this program. – JackHannum Jun 14 '18 at 17:24
  • 1
    @JackHannum - You should post a self answer instead of editing it into the posted question itself. – Broots Waymb Jun 14 '18 at 19:24

1 Answers1

0

msbuild was the wrong tool to use-- I believe csc is the correct tool, as it created an application file.

JackHannum
  • 39
  • 5