1

给定以下站点,在 applicationHost.config 中为 IIS Express 7.5 配置

<site name="MySite" id="1">
    <application path="/" applicationPool="Clr2IntegratedAppPool">
      <virtualDirectory path="/" physicalPath="path\to\the\site" />
      <virtualDirectory path="/VDir1" physicalPath="path\to\the\site" />
      <virtualDirectory path="/VDir2" physicalPath="path\to\the\site" />
      <virtualDirectory path="/VDir3" physicalPath="path\to\the\site" />
    </application>
    <bindings>
      <binding protocol="http" bindingInformation="*:12345:localhost" />
    </bindings>
</site>

在使用 VS2012 从源代码管理资源管理器 (TFS2010) 打开此解决方案时 - 打开解决方案的行为会更改 XML 结构,以便每个 virtualDirectory 节点都位于其自己的应用程序节点内(VS2012 为我创建)

由于这是一个遗留的 .NET 2.0应用程序,它上面显示的虚拟目录中引用控件、文件等 - 只要在配置文件中为它们提供了自己的应用程序,任何来自/to/VDir1/VDir1to的调用/VDir3(例如) 因错误而失败"The virtual path X maps to another application, which is not allowed"

我对那个错误没有任何问题,它是有效的,但是有人知道我如何阻止 VS2012 干预我的配置文件。

其他几点

  • applicationHost.config 是源代码控制的(微不足道的)
  • 有问题的解决方案设置为“使用 IIS Express”,并在项目属性中设置了主机名、端口等配置设置。
4

0 回答 0