有没有办法从 msbuild 获取 属性 的值?

Is there a way to get the value of a property from msbuild?

如果我像这样使用命令行 运行 msbuild:msbuild myproject.dproj /t:Clean;Build /p:Config=Release /p:Platform=Win32 是否有办法让命令行获取该命令的实际 exe 所在位置的值?

您应该编写一个自定义目标来获取该值。

,把这个target加入myproject.dproj

<Target Name="GetOutputValue">  
<Message Importance="high" Text="$(DCC_ExeOutput)"></Message>
</Target>

Then,直接使用此命令调用GetOutputValue目标获取那个值。

msbuild myproject.dproj /t:GetOutputValue