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?
Jeff B.
6 Posts
Can Web.Config be read using Microsoft.Web.Administration?
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
Dalong Zhang...
647 Posts
Microsoft
Re: Can Web.Config be read using Microsoft.Web.Administration?
Nov 22, 2012 01:42 AM|LINK
Hi,
I think the following article will help you :
How to: Read Connection Strings from the Web.config File
http://msdn.microsoft.com/en-us/library/ms178411(v=vs.100).aspx
Feedback to us
Develop and promote your apps in Windows Store