views:

178

answers:

1

I need to know if the application object in ASP 3.0 is shared between all the web site in the same application pool in IIS or it's one application object by site in the same application pool in IIS.

Thanks

+3  A: 

No, it's not shared in an application pool. It's shared in a single application (virtual directory.)


Clarification per Anthony's comment: Application object is shared in a single application. A top level Web site or a virtual directory is considered a separate application on its own. If you have two domain names (host headers) mapped to a single Web site in IIS, it's considered the same application. It doesn't matter how the Web site is referenced by the clients. What matters is whether or not IIS has individual entries for the Web sites.

Mehrdad Afshari
Yes but what about web site. If i got many Web site in the same application in iis (with no virtual folder) is it the same ?
Cédric Boivin
Yes. If you haven't marked them as separate virtual directories, IIS will consider the whole thing a single application.
Mehrdad Afshari
I am not sure i understand correctly your answer.Suppose i have www.stackoverflow.com in a website and www.serverfault.com web site, they are in the same application pool. I declare an application object Application["WebSite"]. If i set the application object web site to "True" will the two web site have "True" in the application object or only the web site where i set the application object ?
Cédric Boivin
If the two URLs are pointing to the same Web site in IIS, then yes.
Mehrdad Afshari
No, each top-level web-site is is separate application even when run in the same pool.
AnthonyWJones
@Mehrdad: I think Cédric has not made the connection that multiple web sites are each an application. I don't think he is asking about two urls alaising for the same website.
AnthonyWJones