Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

web.config, web.debug.config, web.release.config & Publish vs Debug?

I've been trying to understand how to use the different config files and I just found this link which has been very helpful. The only problem is, that it seems the transforms only get taken into account when you 'publish' the solution and not if you just do a generic Debug or Run now.

Generally this wouldn't be to much of a problem, but I'm developing towards Windows Azure, which only allows you to publish to the Cloud. For general debugging I would rather run it locally within the Azure Emulator, but doing so does not 'process' my transforms.

Is there any known workaround to have them transformed during a debugging session?

Edit: ShawnC pointed me to this question.

Which lead me to this extension. I think this will do the job!

like image 477
Kyle Avatar asked Apr 27 '12 12:04

Kyle


1 Answers

You can perform web.config transforms using msbuild. You could put this in your project's AfterBuild target to aid your debugging.

You need to look at the TransformXml msbuild target, passing in: Source=path_to_your/web.config Transform=path_to_your/web.$(ConfigurationName).config and Destination=path_to_your/web.config

like image 125
James Simm Avatar answered Oct 14 '22 14:10

James Simm