如何在Visual Studio 2012中重命名IIS Express网站 [英] How to rename an IIS Express website in Visual Studio 2012

查看:95
本文介绍了如何在Visual Studio 2012中重命名IIS Express网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最初在Webmatrix 2中创建了一个网站.我只是将其称为website1.我现在一直在Visual Studio 2012中的网站上工作,我想对其重命名.它似乎没有显示,您可以直接重命名,但是.sln文件中有一个项目条目,其中包含字符串"website1".我将其重命名并重新启动VS.新名称会短暂显示,但随后会被原始名称覆盖.因此,现在我有了带有新名称的.sln文件,并且文件夹中的任何地方都没有引用旧名称-我已经搜索了每个文件.但是,VS仍然坚持要呼叫网站website1.所以我很困惑.

I initially created a site in Webmatrix 2. I just called it website1. I've now been working on the site in Visual Studio 2012 and I would like to rename it. It doesn't appear you can rename it directly, but in the .sln file there is a project entry which contains the string "website1". I renamed it and re-started 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. But yet VS insists on calling the site website1. So i'm totally confused.

关于VS存储网站名称的任何想法?我唯一能想到的是VS如何与IIS Express集成.也许是从IIS取了这个名字?

Any ideas where VS stores the name of websites? The only thing I can come up with is how VS integrates with IIS Express. Perhaps it is taking the name from IIS instead?

推荐答案

我遇到了完全相同的问题,经过一番梳理,我意识到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. 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文件
  • 找到要重命名的网站的Project条目
  • 更改URL的端口.这将迫使IIS Express将其视为新站点.
  • Open up the .sln file
  • Locate the Project entry for the web site you want to rename
  • Change the port of the URL. This will force IIS Express to treat it as a new site.

希望这对某人有帮助!

这篇关于如何在Visual Studio 2012中重命名IIS Express网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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