Skip to content

Instantly share code, notes, and snippets.

@feO2x
Last active June 21, 2024 06:47
Show Gist options
  • Save feO2x/2c81a218b1e841371adb69fb4836a865 to your computer and use it in GitHub Desktop.
Save feO2x/2c81a218b1e841371adb69fb4836a865 to your computer and use it in GitHub Desktop.
Cleanly integrate .props file from parent directory in MSBuild
<Project>
<PropertyGroup>
<ParentPropsFile>$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))</ParentPropsFile>
</PropertyGroup>
<Import Project="$(ParentPropsFile)" />
<!-- Other property and item groups in thie file -->
</Project>
@feO2x
Copy link
Author

feO2x commented Jun 21, 2024

This gist shows how to cleanly integrate a Directory.Build.props file from the parent directory into the current one (especially without Rider placing squiggly lines all over the place).

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