开发者

msbuild override physical path of .sln file

开发者 https://www.devze.com 2023-02-15 14:46 出处:网络
I am looking for a way to override the release.aspnetcompiler.physical path element in the .sln file. Looking at the micrsoft msbuild reference it doesnt seem to be posible to override this specific o

I am looking for a way to override the release.aspnetcompiler.physical path element in the .sln file. Looking at the micrsoft msbuild reference it doesnt seem to be posible to override this specific output. I was wondering if anyone has passed in a physical path through a build script. My script is below. Thank you for your help

msbuild script

 <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>

solution file

 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


This should allow you to configure your Web project via parameters in the MSBUILD.proj file.

  • In Solution Explorer, select the Web project.

  • On the View menu, click Property Pages.

  • In the left pane, click MSBuild Options.

  • Select Allow this precompiled site to be updatable.

Team Build and aspnet_compiler.exe

<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>
0

精彩评论

暂无评论...
验证码 换一张
取 消