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

I was trying to figure out how to use different configuration files, and I just found this link , which was very useful. The only problem is that it seems that conversions are only taken into account when you publish the solution, and not if you are just doing a general Debug or Run now.

This will usually not be a problem, but I am developing towards Windows Azure, which allows publishing to the cloud. For general debugging, I would prefer to run it locally in Azure Emulator, but this does not β€œhandle” my conversions.

Is there any known workaround for converting them during a debugging session?

Edit: ShawnC pointed me to this question.

Which led me to this extension. I think it will work!

+6
source share
1 answer

You can perform web.config conversions with msbuild. You can put this in your AfterBuild project to help debug.

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

+3
source

Source: https://habr.com/ru/post/914331/


All Articles