1
我有項目解決方案。此外,我在解決方案目錄文件夾與MSBuild文件。獲取MSBuildProjectDirectory的父目錄
在MSBuild的文件我有下面的代碼:
<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>
其中一期工程厲害,因爲我需要在父目錄中去尋找MyApp.Services.Infrastructure.sln
結構:
SolutionFolder
-- MsBuildsFolder
-- ProjectFile
這裏是quite similar question,但不能解決我的問題