msbuild重写.sln文件的物理路径

msbuild重写.sln文件的物理路径,msbuild,Msbuild,我正在寻找一种方法来覆盖.sln文件中的release.aspnetcompiler.physical path元素。查看micrsoft msbuild引用,似乎无法覆盖此特定输出。我想知道是否有人通过构建脚本传递了物理路径。 我的剧本在下面。谢谢你的帮助 msbuild脚本 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Target Name="deploy">

我正在寻找一种方法来覆盖.sln文件中的release.aspnetcompiler.physical path元素。查看micrsoft msbuild引用,似乎无法覆盖此特定输出。我想知道是否有人通过构建脚本传递了物理路径。 我的剧本在下面。谢谢你的帮助

msbuild脚本

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

这应该允许您通过MSBUILD.proj文件中的参数配置Web项目

  • 在解决方案资源管理器中,选择Web项目

  • 在“视图”菜单上,单击“属性页”

  • 在左侧窗格中,单击MSBuild选项

  • 选择“允许此预编译站点可更新”


adding/v:diag告诉您关于输出路径和属性重写的影响的信息是什么?它给出了“project_3d958438-10f1-4211-bc7f-f0a5e5601c3f_AspNetPhysicalPath=…\foo”
 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
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuid/2003">             
<Target Name="Build">
    <AspNetCompiler VirtualPath="/WebApplication1" PhysicalPath="C:\MyProjects\WebApplication1" TargetPath="C:\MyProjects\WebApplication1\PrecompiledWeb" />
</Target>     
</Project>