[英]How to rename an IIS Express website in Visual Studio 2012
I initially created a site in Webmatrix 2. I just called it website1. 我最初在Webmatrix 2中创建了一个站点。我刚才称它为website1。 I've now been working on the site in Visual Studio 2012 and I would like to rename it.
我现在一直在Visual Studio 2012中的网站上工作,我想重命名它。 It doesn't appear you can rename it directly, but in the .sln file there is a project entry which contains the string "website1".
它似乎不能直接重命名,但在.sln文件中有一个包含字符串“website1”的项目条目。 I renamed it and re-started VS.
我将其重命名并重新启动VS. The new name briefly displays but then gets overwritten with the original name.
新名称会暂时显示,但会被原始名称覆盖。 So now I have the .sln file with the new name and nowhere within the folders does it reference the old name - i've searched every file.
所以现在我有了新名称的.sln文件,文件夹中没有任何地方引用旧名称 - 我搜索过每个文件。 But yet VS insists on calling the site website1.
但是VS坚持要求调用网站1。 So i'm totally confused.
所以我完全糊涂了。
Any ideas where VS stores the name of websites? VS存储网站名称的任何想法? The only thing I can come up with is how VS integrates with IIS Express.
我唯一能想到的是VS如何与IIS Express集成。 Perhaps it is taking the name from IIS instead?
也许它取而代之的是IIS的名字?
I just encounter the same problem with you during using VS 2013, it turned out that it's caused by IIS Express, finally I solved it by following steps: 我在使用VS 2013时遇到了同样的问题,结果发现它是由IIS Express引起的,最后我通过以下步骤解决了这个问题:
I had the exact same problem, and after a lot of hair pulling realized that IIS Express (as you said) somehow was the culprit. 我有完全相同的问题,经过大量的头发拉动意识到IIS Express(如你所说)不知何故是罪魁祸首。 However, I couldn't find out where the site name was stored.
但是,我找不到网站名称的存储位置。
This is what I ended up doing (in addition to renaming directories and replacing the old project name with the new one in the solution file): 这就是我最终做的事情(除了重命名目录并用解决方案文件中的新项目替换旧项目名称):
.sln
file .sln
文件 Project
entry for the web site you want to rename Project
条目 Hope this helps someone! 希望这有助于某人!
I had the same problem for HTTPS and Visual Studio 2015 . 我对HTTPS和Visual Studio 2015也有同样的问题。
The IIS Express configuration file "C:\\Users{username}\\Documents\\IISExpress\\config\\applicationhost.config" didn´t have the reference for my site. IIS Express配置文件“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. 我删除了旧拷贝站点的条目,关闭并重新打开项目,一切都正确。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.