Demonstrates how you can convert a relative path to an absolute path in MSBuild
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Demo"> | |
<!-- Demonstrates how you can convert a relative path to a full path in MSBuild --> | |
<PropertyGroup> | |
<Filepath>sample\file.txt</Filepath> | |
</PropertyGroup> | |
<Target Name="Demo"> | |
<PropertyGroup> | |
<_FullPath>$([System.IO.Path]::GetFullPath($(Filepath)))</_FullPath> | |
</PropertyGroup> | |
<Message Text="Fullpath: '$(_FullPath)'" Importance="high"/> | |
</Target> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment