I have a Multi-tenant Deployment projects . I have about 150 tenants, each tenant represents an ASP.net site. Each of this ASP.net site has a web.config file with different connection string and other client specific settings. In all of my web.config file I have this line
<compilation debug="true" targetFramework="4.5">
I want to remove debug=“true” from the above tag. I created a NuGet package with a single transform file called Web.Release.config. My transform file looks like this
I ran this package on all of my 150 tenants, but my default web.config didn’t change , it did not remove debug=“true” from any web.config file. I don’t know what I am doing wrong.
Thanks for getting in touch! I’m sorry to hear you’re hitting this roadblock! It looks like your syntax is correct, and testing this out seems to remove the debug attribute in my local instance. There’s a very helpful online tool to quickly test out transformations so you don’t have to deploy each time you want to test a change. Do you see the same result using this? https://webconfigtransformationtester.apphb.com/
If it works as expected on that site, it may come down to the configuration of the step. Would you be willing to provide a copy of your verbose deployment logs with debugging variables enabled? The following doc page outlines how you can produce and export this.
If it still doesn’t work on that transformation tester site, would you be willing to provide a copy of your config files in addition to the log? I’ll be happy to run a test with the exact files.
I look forward to hearing back and getting to the bottom of this one!
Thanks for your reply. It only works if both Web.config and Web.Release.config are in the same NuGet deployment package. My problem is that my NuGet deployment package contains only Web.Release.config . another idea I have is running powershell script to remove debug=“true” from web.config file. But I don’t know powershell , can you please help me write the script . My script will be Post-deployment script and it should be able read all the web.config files of my 150 tenants
Thanks for following up! That’s good to hear it works when both are in the same package. Since the web.config file isn’t normally in your package, a PowerShell script could accomplish this if you’re unable to include it in your package going forward. Defining an absolute path to the web.config file isn’t supported unfortunately. If you haven’t seen it yet, you can refer to our advanced configuration transforms examples doc page which outlines what is supported.