Creating a new website on IIS: Application vs. Virtual Directory. Whats the difference?

后端 未结 3 619
暖寄归人
暖寄归人 2020-12-14 00:31

When you create a new website on IIS, you get to choose between an \"Application\" and a \"Virtual Directory\". What is the difference between those two options?

相关标签:
3条回答
  • 2020-12-14 01:27

    A virtual directory is just a pointer to where web pages are stored.

    An Application reserves memory in IIS for your web pages. If you are attempting to run ASP pages and plan to make use of session variables and the such then you must use an application. An Application can make use of a virtual directory or it may just exist within the default web site directory (inetpub/wwwroot/)

    0 讨论(0)
  • 2020-12-14 01:33

    From the point of view of a web developer:

    A virtual directory is the IIS 5 (Windows 2000 and earlier) container for HTML content. A virtual directory can also be configured to allow the interpretation of Active Server Pages (ASP) scripts and/or the execution of Common Gateway Interface (CGI) applications. A virtual directory CANNOT host an ASP.Net web application.

    The "application" container type was introduced with IIS 6 (Windows XP / Windows Server 2003 and later). It allows for hosting of ASP.Net web applications.

    0 讨论(0)
  • 2020-12-14 01:34

    There are a few differences, here are the biggest:

    • In IIS 6 and up, you can assign an application a certain "protection" level. (e.g. protection levels, application pools, etc). You can't do this with Virtual Directories
    • If you are working with ASP.NET, the search for the master "Web.config" file for your application stops at your application level. For a working directory it will actually check your parent hierarchy for settings as well.

    These are the two biggest differences in my opinion, although there are other small ones as well.

    0 讨论(0)
提交回复
热议问题