Skip to content

Instantly share code, notes, and snippets.

@sayedihashimi
Created December 23, 2012 23:06
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sayedihashimi/4366619 to your computer and use it in GitHub Desktop.
Save sayedihashimi/4366619 to your computer and use it in GitHub Desktop.
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