Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Demonstrates how you can convert a relative path to an absolute path in MSBuild
<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