msbuild解决方案文件

时间:2011-03-07 17:32:48

标签: msbuild

我创建了一个msbuild文件,它将构建一个解决方案文件(注意:不是项目文件)。我希望能够在msbuild文件中更改调试和释放目标路径。我该怎么做呢?非常感谢你。

msbuild文件

   <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <Target Name="deploy">
        <MSBuild Projects="foo.sln" Properties="Configuration=Release" ContinueOnError="false" />
      </Target>
    </Project>

解决方案文件下面:

 Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "foo", ".", "{3D958438-10F1-4211-BC7F-F0A5E5601C3F}"
        ProjectSection(WebsiteProperties) = preProject
            TargetFramework = "3.5"
            Debug.AspNetCompiler.VirtualPath = "/foo"
            Debug.AspNetCompiler.PhysicalPath = "..\foo\"
            Debug.AspNetCompiler.TargetPath = "..\..\PrecompiledWeb\foo\"
            Debug.AspNetCompiler.Updateable = "true"
            Debug.AspNetCompiler.ForceOverwrite = "true"
            Debug.AspNetCompiler.FixedNames = "false"
            Debug.AspNetCompiler.Debug = "True"
            Release.AspNetCompiler.VirtualPath = "/foo"
            Release.AspNetCompiler.PhysicalPath = "..\foo\"
            Release.AspNetCompiler.TargetPath = "..\..\PrecompiledWeb\foo\"
            Release.AspNetCompiler.Updateable = "true"
            Release.AspNetCompiler.ForceOverwrite = "true"
            Release.AspNetCompiler.FixedNames = "false"
            Release.AspNetCompiler.Debug = "False"
            VWDPort = "51644"
            DefaultWebSiteLanguage = "Visual Basic"
        EndProjectSection
    EndProject

1 个答案:

答案 0 :(得分:2)

要更改输出,请设置OutDir属性。所以而不是:

  Properties="Configuration=Release"

尝试:

  Properties="Configuration=Release;OutDir=d:\myCode\out\"