Skip to content

Instantly share code, notes, and snippets.

@guitarrapc
Created August 17, 2019 19:47
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/4ebd5b33bd02ec4cff1ac9cbe535245c to your computer and use it in GitHub Desktop.
Save guitarrapc/4ebd5b33bd02ec4cff1ac9cbe535245c to your computer and use it in GitHub Desktop.
Simple Single Executable separate 2.1 and 3.0
using System;
namespace SimpleSingleExecutable
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup Condition="'$(PublishSingleFile)' == 'true'">
<TargetFramework>netcoreapp3.0</TargetFramework>
<PublishSingleFile>true</PublishSingleFile>
<PublishTrimmed>true</PublishTrimmed>
<IncludeSymbolsInSingleFile>true</IncludeSymbolsInSingleFile>
</PropertyGroup>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment