Delete a specific Tag in Web.config file

Dear Sir,

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. But there is a common tag that is in all the web.config files that we don’t it need any more and needs to be deleted . We need a way to find this tag and then delete it. This is the tag

<add name="Elmah" path="elmah.axd" />

in the web.config it is defined like this

 <handlers>     
<add name="Elmah" path="elmah.axd" />  (We only need to delete this)
 </handlers>

Is there any easy way to do this.

Any help would be greatly appreciated!

Hi,

Thanks for getting in touch! You can delete elements in your config file by using the Transform="Remove" syntax in your transform file. In your case, it would probably look something like this:

 <handlers>     
<add xdt:Transform="Remove" />
 </handlers>

You can reference more options, details and examples in Microsoft’s documentation. :slight_smile:
https://msdn.microsoft.com/en-us/library/dd465326(v=vs.110).aspx

I hope this helps! Don’t hesitate to reach out if you have any further questions going forward.

Best regards,

Kenny

Thank you for your reply. This tag will remove everything I only want to remove one tag . Also how do we deploy this in a multi tenant deployment?. Do we need to create a package which will only have 1 transform file?

Please advise how can i deploy 1 Transform file to all of my 150 tenants

Hi,

Thanks for following up! I’m just reaching out here to let you know I’ve responded to your other thread and we can continue the discussion there. :slight_smile:

Best regards,

Kenny

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.