IIS Express Visual Studio集成-更改站点名称 [英] IIS Express Visual Studio Integration - Changing site name

查看:82
本文介绍了IIS Express Visual Studio集成-更改站点名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始将Visual Studio 2010 SP1与IIS Express结合使用.当Visual Studio启动IIS Express时,它指定用来启动IIS Express的站点"的名称.该站点的名称似乎是从我的Web项目的名称派生的. Visual Studio是否可以使用其他名称启动网站?例如,如果我的Web项目的名称为"WebProject1",则在Visual Studio启动IIS Express时,它将使用以下命令:

I'm just starting to use Visual Studio 2010 SP1 with IIS Express. When Visual Studio launches IIS Express, it specifies the name of the "site" to launch IIS Express with. The name of the site seems to be derived from the name of my web project. Is it possible to have Visual Studio launch a site with some other name? For instance, if my web project's name is "WebProject1", when Visual Studio launches IIS Express, it will use the following command:

iisexpress.exe /site:WebProject1

我想强迫它这样做:

iisexpress.exe /site:MyMasterSite

那里有什么主意吗?

推荐答案

您将需要在applicationhost.config文件中进行更改.可以在user/documents/iisexpress/config文件夹中找到.在配置文件的system.applicationhost节点下,您将找到一个sites节点,该节点应允许您在site name节点中设置名称.

You will want to change this in the applicationhost.config file. This can be found in the user/documents/iisexpress/config folder. In the config file, under the system.applicationhost node you will find a sites node that should allow you to set the name in the site name node.

    <sites>
        <site name="WebSite1" id="1" serverAutoStart="true">
            <application path="/">
                <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
            </application>
            <bindings>
                <binding protocol="http" bindingInformation=":8080:localhost" />
            </bindings>
        </site>
        <siteDefaults>
            <logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
            <traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
        </siteDefaults>
        <applicationDefaults applicationPool="Clr4IntegratedAppPool" />
        <virtualDirectoryDefaults allowSubDirConfig="true" />
    </sites>

这篇关于IIS Express Visual Studio集成-更改站点名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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