MSBuild には、MSBuildProjectDirectory の上のディレクトリを表すプロパティがあります。
<PropertyGroup>
<BuildDir>$(MSBuildProjectDirectory)\..</PRSBuildDir>
</PropertyGroup>
次に、このプロパティを使用する必要がありますが、ディレクトリ文字列が含まれないようにクリーンアップする必要があります..
。つまり..
、現在のプロジェクト ファイルが にある場合C:\Test\Tom\MyDir
、文字列 を含むプロパティが必要になるように、評価が必要C:\Test\Tom
です。
私が尋ねている理由は、次のようなコマンドを実行しようとしているためです。
msiexec /passive /i "D:\Build\2.3.84.40394\Deployment\..\Vendor\LogParser.msi"
しかし、msiへのパスについて不平を言っています:This installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package.