获取MSBuildProjectDirectory的父目录
我有项目解决方案。此外,我在解决方案目录文件夹中还有msbuild文件 在msbuild文件中,我有下一个代码:获取MSBuildProjectDirectory的父目录,msbuild,directory,parent,targets,Msbuild,Directory,Parent,Targets,我有项目解决方案。此外,我在解决方案目录文件夹中还有msbuild文件 在msbuild文件中,我有下一个代码: <PropertyGroup Label="Build Directories"> <RootPath>$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)'))</RootPath> </PropertyGroup> <ItemGroup> &
<PropertyGroup Label="Build Directories">
<RootPath>$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)'))</RootPath>
</PropertyGroup>
<ItemGroup>
<MSBuildProjectInfrastructure Include="$(RootPath)MyApp.Services.Infrastructure.sln">
<AdditionalProperties>Configuration=$(Configuration);Platform=$(Platform);</AdditionalProperties>
</MSBuildProjectInfrastructure>
</ItemGroup>
这里是,但没有解决我的问题要获取父文件夹,可以让MSBuild通过内置属性函数确定该文件夹中已知文件的位置:
$([MSBuild]::GetDirectoryNameOffileOver($(MSBuildThisFileDirectory),MyApp.Services.Infrastructure.sln))
要获取父文件夹,可以让MSBuild通过内置属性函数确定该文件夹中已知文件的位置:
$([MSBuild]::GetDirectoryNameOffileOver($(MSBuildThisFileDirectory),MyApp.Services.Infrastructure.sln))
SolutionFolder
-- MsBuildsFolder
-- ProjectFile
<PropertyGroup>
<RootPath>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), MyApp.Services.Infrastructure.sln))</RootPath>
</PropertyGroup>