When I try to pass the directory path in an MSBuild script as follows:
MSBuild.exe myproj.proj /p:DirPath="C:\this\is\directory\"
And in the .proj file I use it as
<PropertyGroup> <FilePath>$(DirPath)file.txt</FilePath> <PropertyGroup>
Then MSBuild compiles FilePath as c:\this\is\directory"file.txt . If I pass DirPath without quotes but with a trailing slash ( /p:DirPath=c:\this\is\directory\ ) or without a trailing slash traits, but with quotes ( /p:DirPath="c:\this\is\directory\" ), everything works fine.
What can be done to allow traversal of a directory path with a trailing slash (this would be more convenient) and in quotation marks (since the path may contain spaces)? Or is this a bug in MSBuild and should I use some workaround, like removing backslash when passing it to msbuild?
Dmitry Lobanov
source share