简体   繁体   中英

Can I transform a web.config with an Albacore task?

When I publish from Visual Studio 2010, it transforms the web.config according to the Web.Debug.config or Web.Release.config . Is there a way to do that with aspnet_compiler or something else in Albacore?

A similar question was asked recently on the mailing list. I don't know if this is the same situation that you are facing, but hopefully it will help you out. Based on the needs of that person, I recommended the following for the msbuild task.

CLIENT_SOURCE_DIR = 'C:/Builds/MySolution/Source/Client/'
PUBLISH_CLIENT_DIR = 'C:/Builds/MySolution/Publish/Client/'

desc 'Publish the web site'
msbuild :publish do |msb|
  msb.solution = "#{CLIENT_SOURCE_DIR}/Client.csproj"
  msb.targets [:Clean, :Rebuild]
  msb.properties = { 
    :configuration => :Release, 
    :UseWPP_CopyWebApplication => true, 
    :PipelineDependsOnBuild => false,
    :webprojectoutputdir => "#{PUBLISH_CLIENT_DIR}/",
    :outdir => "#{PUBLISH_CLIENT_DIR}/bin/"
  }
end 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM