IIS 7.5 Express新虚拟目录

时间:2011-01-19 04:01:13

标签: iis iis-express

如何添加新的虚拟目录?

我收到错误(无法找到类型或命名空间名称'xxx'),但文件都在/ bin中。

我尝试过像这样编辑applicationhost.config:

<site name="WebSite1" id="1" serverAutoStart="true">
    <application path="/" applicationPool="Clr2IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
        <virtualDirectory path="/SubFolderApp" physicalPath="%IIS_SITES_HOME%\WebSite1\SubFolderApp" allowSubDirConfig="true" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation=":80:localhost" />
    </bindings>
</site>

1 个答案:

答案 0 :(得分:19)

您需要创建子应用程序。您的配置创建了子虚拟目录。下面的配置将/ SubFolderApp转换为应用程序。

<site name="WebSite1" id="1" serverAutoStart="true">
   <application path="/" applicationPool="Clr2IntegratedAppPool">
     <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
   </application>
   <application path="="/SubFolderApp" applicationPool="Clr2IntegratedAppPool">
     <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1\SubFolderApp" />
   </application>
    <bindings>
      <binding protocol="http" bindingInformation=":80:localhost" />
   </bindings>
</site>