Skip to content

Instantly share code, notes, and snippets.

@guitarrapc
Last active August 18, 2019 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guitarrapc/372e3306a39444747fb1e87ca2c2244f to your computer and use it in GitHub Desktop.
Save guitarrapc/372e3306a39444747fb1e87ca2c2244f to your computer and use it in GitHub Desktop.
Single Executable with csproj
using System;
namespace SimpleSingleExecutable
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<OutputType>Exe</OutputType>
<PublishSingleFile>true</PublishSingleFile>
<IncludeSymbolsInSingleFile>true</IncludeSymbolsInSingleFile>
</PropertyGroup>
<PropertyGroup Condition="'$(SelfContained)' == 'true'">
<PublishTrimmed>true</PublishTrimmed>
</PropertyGroup>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment