IIS Express与Website Project,如何在虚拟目录中使用? [英] IIS Express with Website Project, how to use inside virtual directory?

查看:162
本文介绍了IIS Express与Website Project,如何在虚拟目录中使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的生产环境有根,我的虚拟目录将位于根目录内的/ brazil文件夹中。

My production environment have a root, and my virtual directory will be at /brazil folder inside the root.

当我转换我的网站项目(不是网络应用程序)时,因为我的网站文件夹是巴西,所以它与/巴西的卡西尼正常工作,IIS Express将网站置于根目录,我该如何更改?

When I convert my website project(not web application), that works correctly with Cassini at /brazil since my website folder is brazil, IIS Express put the site at root, how can I change this?

推荐答案

我发现IIS Express与Web应用程序存在类似问题。从我所看到的,IIS Express实际上允许您在Project Url字段中定义一个文件夹,但是在启动时它会生成2个网站,一个包含文件夹,另一个包含根应用程序。问题在于它使用相同的文件夹,这两个文件都带来了web.config继承问题。

I'm seeing similar problems with IIS Express with web applications. From what I'm seeing, IIS Express actually allows you to define a folder in the 'Project Url' field, but then when launching it generates 2 websites, one with the folder and another for the root application. Problem with this is that it is using the same folder for both which brings web.config inheritance issues.

我的解决方案是编辑托管文件并更改physicalPath for根虚拟目录到我系统中的空文件夹

My solution was to go edit the hosting file and change the physicalPath for the root virtual directory to an empty folder in my system

例如:

<site name="MySite1" id="1">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="C:\VisualStudioProjects\2010\MySite1\MySite1" />
    </application>
    <application path="/ssd">
        <virtualDirectory path="/" physicalPath="C:\VisualStudioProjects\2010\MySite1\MySite1" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation="*:59473:localhost" />
        <binding protocol="https" bindingInformation="*:44302:localhost" />
    </bindings>
</site>

对此:

<site name="MySite1" id="1">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="C:\TEMP\New folder" />
    </application>
    <application path="/ssd">
        <virtualDirectory path="/" physicalPath="C:\VisualStudioProjects\2010\MySite1\MySite1" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation="*:59473:localhost" />
        <binding protocol="https" bindingInformation="*:44302:localhost" />
    </bindings>
</site>

这篇关于IIS Express与Website Project,如何在虚拟目录中使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆