IIS 7 & IIS 8
Can Web.Config be read using Microsoft.Web.Administration?
Last post Nov 22, 2012 01:42 AM by Dalong Zhang - MSFT
Nov 20, 2012 07:17 PM|LINK
I have the need to dynamically list all applications running under IIS on a given web server. Within each IIS app (i.e. web site, WCF service, etc.) I want to check for database connection strings. If there are connection strings, I want to copy them from
the web.config file and list those out as well.
I can list the IIS apps easily enough using the Microsoft.Web.Administration DLL; However, I can't figure out a way to read the web.config file. Is this possible?
--- Thanks, Jeff
Nov 22, 2012 01:42 AM|LINK
I think the following article will help you :
How to: Read Connection Strings from the Web.config File