Skip to content

Instantly share code, notes, and snippets.

@altrive
Last active September 15, 2017 15:39
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 altrive/3b8587f868d3270e7dfc94e21800e840 to your computer and use it in GitHub Desktop.
Save altrive/3b8587f868d3270e7dfc94e21800e840 to your computer and use it in GitHub Desktop.

Reference: https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build

Step 1. Place following xml file to each projects

FileName: Directory.Build.props

<?xml version="1.0" encoding="utf-8" ?>
<Project>
  <Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
</Project>

2. Place following xml file to solution root folder

FileName: Directory.Build.props

<?xml version="1.0" encoding="utf-8" ?>
<Project>
  <!-- Override common build properties -->
  <PropertyGroup>
    <LangVersion>latest</LangVersion>
    <NoWarn>$(NoWarn);CS1998;</NoWarn>
  </PropertyGroup>
</Project>

3. Build solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment