I need to convert the function "path::combine(path1, path2)". Please help me if you have some idea. Thank you开发者_StackOverflow社区!
Use the CombinePath Task:
<Project DefaultTargets="DefaultTarget" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <MyBasePath>.\a\b</MyBasePath>
        <MySecondPath>c\d</MySecondPath>
    </PropertyGroup>
    <Target Name="Combine">
        <PropertyGroup>
            <MySecondPath Condition="$(MySecondPath)==''">.\</MySecondPath>
        </PropertyGroup>
        <CombinePath BasePath="$(MyBasePath)" Paths="$(MySecondPath)">
            <Output TaskParameter="CombinedPaths" PropertyName="CombineOutput" />
        </CombinePath>
    </Target>
    <Target Name="DefaultTarget" DependsOnTargets="Combine">
        <Message Text="Result from Combine is $(CombineOutput)" />
    </Target>
</Project>
Updating this post for newer MsBuild versions. From MSBuild 4.0 and up, you can use property functions
$([System.IO.Path]::Combine($(Path1),$(Path2)))
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论