Skip to content

Instantly share code, notes, and snippets.

@guitarrapc
Created August 17, 2019 19:48
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/c8b7ba487718ede9bd5828e1d1d9cea4 to your computer and use it in GitHub Desktop.
Save guitarrapc/c8b7ba487718ede9bd5828e1d1d9cea4 to your computer and use it in GitHub Desktop.
Single Executable and Global Tools
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup Condition="'$(PublishSingleFile)' != 'true'">
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackAsTool>true</PackAsTool>
<PackageId>test</PackageId>
<PackageVersion>$(Version)</PackageVersion>
<Authors>guitarrapc</Authors>
<Copyright>guitarrapc</Copyright>
<Description>Test.</Description>
<PackageProjectUrl>https://github.com/guitarrapc/dotnet-lab</PackageProjectUrl>
<RepositoryUrl>$(PackageProjectUrl)</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
<PropertyGroup Condition="'$(PublishSingleFile)' == 'true'">
<TargetFramework>netcoreapp3.0</TargetFramework>
<PublishSingleFile>true</PublishSingleFile>
<PublishTrimmed>true</PublishTrimmed>
<IncludeSymbolsInSingleFile>true</IncludeSymbolsInSingleFile>
</PropertyGroup>
</Project>
using System;
namespace SimpleSingleExecutable
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment