Skip to content

Instantly share code, notes, and snippets.

@XerShade
Created August 20, 2023 17:59
Show Gist options
  • Save XerShade/a84dec660e5ceb070c4ef29b630f823c to your computer and use it in GitHub Desktop.
Save XerShade/a84dec660e5ceb070c4ef29b630f823c to your computer and use it in GitHub Desktop.
The .csproj file template that I use for most of my C# projects.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<BaseOutputPath>$(SolutionDir)bin\$(AssemblyName)</BaseOutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<Title>$(AssemblyName)</Title>
<Authors></Authors>
<Company></Company>
<Product></Product>
<Description></Description>
<Copyright>© $(Authors) 2023 - 2023</Copyright>
<RepositoryUrl></RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageProjectUrl></PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags></PackageTags>
<PackageOutputPath>$(SolutionDir)pkg\$(AssemblyName)</PackageOutputPath>
<AssemblyVersion>$(VersionPrefix)</AssemblyVersion>
<FileVersion>$(VersionPrefix)</FileVersion>
<Version>1.0.0.0</Version>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
<DefineConstants>$(DefineConstants);DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugSymbols>false</DebugSymbols>
<DefineConstants>$(DefineConstants);RELEASE;TRACE;</DefineConstants>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'x64' or '$(Platform)' == 'AnyCPU' ">
<DefineConstants>$(DefineConstants);X64</DefineConstants>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '(Platform)' == 'x86' ">
<DefineConstants>$(DefineConstants);X86</DefineConstants>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<None Include="..\..\LICENSE">
<Pack>True</Pack>
<PackagePath>content</PackagePath>
</None>
<None Include="..\..\README.md">
<Pack>True</Pack>
<PackagePath>content</PackagePath>
</None>
</ItemGroup>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment