设置MSBuild任务的输出路径

设置MSBuild任务的输出路径,msbuild,Msbuild,在以下简单的MSBuild文件中,我希望覆盖在.sln或.csproj文件中定义的输出路径。在第13行中,您可以看到我为现有VS解决方案调用了MSBuild任务。通常,作为该解决方案一部分的项目具有存储输出的属性。对于我的脚本,我希望覆盖它,以便我的“构建自动化”使用与默认目录不同的目录 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Default"

在以下简单的MSBuild文件中,我希望覆盖在.sln或.csproj文件中定义的输出路径。在第13行中,您可以看到我为现有VS解决方案调用了MSBuild任务。通常,作为该解决方案一部分的项目具有存储输出的属性。对于我的脚本,我希望覆盖它,以便我的“构建自动化”使用与默认目录不同的目录

<Project 
    xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
    DefaultTargets="Default">

    <PropertyGroup>
        <appname>Some App</appname>
        <version>2.9.1</version>
        <file_xap>Some.App.WP8_$(version).$([System.DateTime]::Now.ToString(`yyyyMMddHHmmss`)).xap</file_xap>
    </PropertyGroup>

    <Target Name="Default">

        <MSBuild Projects="C:\Users\User\Documents\Visual Studio 2013\Projects\SomeApp\SomeApp.sln" Properties="Configuration=Debug;Platform=Any CPU">
        </MSBuild>
        <Message Text="Output file: $(file_xap)"/>
    </Target>
</Project>

一些应用程序
2.9.1
Some.App.WP8_$(version)。$([System.DateTime]::Now.ToString(`yyyyMMddHHmmss`)).xap

因此,实际的问题是:我如何调用该sln的MSBuild,使输出(在这种情况下是xap文件)能够到达另一个目录(除了xap文件之外的所有输出也可以)?

我将在这里发布我的完整xml,以便您能够理解所有内容 项目结构如下:

MyProject----MyProject.sln
         ----MyProject.Server---    
                        ----MyProject.Server.proj
                        ----Other server project classes and stuff
         ----MyProject.Client---
                        ----MyProject.Client.proj
                        ----Client project related stuff
         ----BuildFromXmlFldr---
                                ----build_both_proj.xml <---This is the example file i posted here
因此,输出是在
Target
标记的
Properties
属性中确定的

Properties="Configuration=$(Configuration);Platform=$(Platform);OutputPath=$(ServerOutput);"

你看到了吗?你解决了吗?@MBH抱歉。还没有。我找到了。我会尽快发布答案
c:\path_to_msbuild\MSBuild.exe build_both_proj.xml /t:BuildAll
Properties="Configuration=$(Configuration);Platform=$(Platform);OutputPath=$(ServerOutput);"