Retrieving IIS Web Site Property Value during Application_Start in ASP.NET Web app.
am 19.04.2008 00:36:10 von Peter SchwartzHow would it be possible for an ASP.NET Web application, in it's
Application_Start event procedure, to programmatically determine the Web
site (in IIS) that the Web app is running under/for.
Say for example, that I have a Web site defined in IIS, with the
"Application name" property set to the value "MyWebApp". How could I get
the value "MyWebApp" into a string variable in Application_Start of the
ASP.NET Web application?
Please note that I'd like to get this value directly from IIS, and not have
to manually duplicate it in Web.config.
I'm currently using ASP.NET 3.5 with IIS 5.1 and 6, but will soon be
migratign everything to IIS 7.
Thanks.