Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.