Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

.net

albacore

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?

like image 589
thitemple Avatar asked Nov 21 '25 07:11

thitemple


1 Answers

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 
like image 137
Derick Bailey Avatar answered Nov 24 '25 00:11

Derick Bailey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!