简体   繁体   English

如何在Visual Studio项目中更改IIS Express站点名称

[英]How to change IIS Express site name in Visual studio project

Hi I have two solution file one is called WWSearch and the other WWSearchDev. 嗨,我有两个解决方案文件,一个叫WWSearch,另一个叫WWSearchDev。 WWSearchDev was copied from WWSearch. WWSearchDev是从WWSearch复制的。 both solution has ASP.net web form project. 这两个解决方案都有ASP.net Web表单项目。

I searched everywhere in WWSearchDev for the word "WWSearch" and it has no reference to "WWSearch". 我在WWSearchDev的任何地方搜索“WWSearch”这个词,它没有提到“WWSearch”。 But when I run the code IIS express still says the site name is WWSearch 但是当我运行代码时IIS表示仍然说网站名称是WWSearch

The problem is the path of WWSearchDev should be C:\\VSS\\WWSearchDev. 问题是WWSearchDev的路径应该是C:\\ VSS \\ WWSearchDev。 *see screenshot. *见截图。

I tried adding a new site in IIE express application config file in C:\\Users\\%username%\\Documents\\IISExpress\\config\\Applicationhost.config. 我尝试在C:\\ Users \\%username%\\ Documents \\ IISExpress \\ config \\ Applicationhost.config中的IIE express应用程序配置文件中添加一个新站点。 but It still not working 但它仍然无法正常工作

please help.. Thank you 请帮忙..谢谢

http://i.imgur.com/9ubfxAa.png

This is the applicationhost.config for IIS 这是IIS的applicationhost.config

<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>
            <site name="WWSearch" id="2">
                <application path="/" applicationPool="Clr4IntegratedAppPool">
                    <virtualDirectory path="/" physicalPath="C:\VSS\WWSearch" />
                </application>
                <bindings>
                    <binding protocol="http" bindingInformation="*:49454:localhost" />
                </bindings>
            </site>
            <site name="WWSearchDev" id="3">
                <application path="/" applicationPool="Clr4IntegratedAppPool">
                    <virtualDirectory path="/" physicalPath="C:\VSS\WWSearchDev" />
                </application>
                <bindings>
                    <binding protocol="http" bindingInformation="*:52184: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>

I had the same problem for HTTPS and Visual Studio 2015. 我对HTTPS和Visual Studio 2015也有同样的问题。

The IIS Express configuration file : IIS Express配置文件:

"C:\\Users{username}\\Documents\\IISExpress\\config\\applicationhost.config" didn´t have the reference for my site. “C:\\ Users {username} \\ Documents \\ IISExpress \\ config \\ applicationhost.config” 没有我网站的参考。

I found the reference inside the solution directory in a hide directory 我在隐藏目录中找到了解决方案目录中的引用

"{Solution}\\.vs\\config\\applicationhost.config" “{解决方案} \\ VS \\设置\\对ApplicationHost.config”

I removed the entry for the old copy site, closed and reopen the project and everything was right. 我删除了旧拷贝站点的条目,关闭并重新打开项目,一切都正确。

  1. Open with sublime text3 用sublime text3打开
  2. Find folder .vs > config > applicationhost.config 找到文件夹.vs> config> applicationhost.config
  3. Searh old Site name & Change new name Searh旧网站名称和更改新名称
  4. save

1 ) find YourWebSite.sln file 1)找到YourWebSite.sln文件

2) open with notepad 2)用记事本打开

3) in 5 or 6th line, find you website name, rename it 3)在第5或第6行,找到你的网站名称,重命名

4) save&exit 4)保存并退出

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM