Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to call Path.Combine from MSBuild?

I have an <Exec> task that MSBuild runs whenever it builds my library. It looks like this:

<Exec Command="..\packages\xunit.runner.console.2.0.0\tools\xunit.console bin\$(Configuration)\Core.dll"/>

It seems to be working fine, however I'm worried that this may not work on Linux and OS X because it uses backslashes instead of the standard / for the directory separator. Is there a way to call Path.Combine from MSBuild so I can avoid this problem?

like image 427
James Ko Avatar asked Aug 22 '15 18:08

James Ko


Video Answer


1 Answers

Use msbuild property functions

$([System.IO.Path]::Combine($(Path1),$(Path2)))
like image 164
Avner Avatar answered Oct 07 '22 00:10

Avner