[英]Why is IIS 8.0 Express using the old project names after rename in Visual Studio 2012
After some naming confusing my team decided to rename some projects and the namespaces for all the existing code files in the project. 在命名混乱之后,我的团队决定重命名一些项目以及该项目中所有现有代码文件的名称空间。 (In Visual Studio 2012) (在Visual Studio 2012中)
We've changed: 我们已更改:
After all of this, IIS 8.0 Express still insists on using the old project names for the site names (while locally debugging). 毕竟, IIS 8.0 Express仍然坚持使用旧项目名称作为站点名称(在本地调试时)。 How can I fix this? 我怎样才能解决这个问题?
Edit: The real question is this: How does IIS 8.0 Express determine the site name ? 编辑:真正的问题是: IIS 8.0 Express如何确定站点名称 ?
Here's a snipped from (one of) the .csproj files for a website 这是一个网站的.csproj文件(其中之一)的摘要
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>52143</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:53177/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
...and nothing for site name. ...网站名称一无所有。
The problem isn't in the Project at all. 问题根本不在项目中。
In the applicationhost.config file (iis.net link) , typically in 在applicationhost.config文件(iis.net链接)中 ,通常在
(user-dir)\\My Documents\\IISExpress\\config\\applicationhost.config
There are settings for the a site. 有一个站点的设置。 Simply change the name attribute of the site. 只需更改站点的名称属性。
<site name="MvcApplication1" id="3">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="(whateverpath)\My Documents\Visual Studio 2012\Projects\MvcApplication1\MvcApplication1" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:57733:localhost" />
</bindings>
</site>
You will have to find and change these names in csproj files and sln files as well (which are basically xml files with file extensions that VS uses). 您还必须在csproj文件和sln文件(它们基本上是VS使用的带有文件扩展名的xml文件)中查找和更改这些名称。
First and most importantly, back up all your stuff, just in case. 首先也是最重要的是,备份所有内容,以防万一。 Next, do a text search for the old names (hopefully they weren't called something like "if") within the csproj/sln files. 接下来,在csproj / sln文件中执行文本搜索以查找旧名称(希望它们没有被称为“ if”)。 Change the names, and then try launching. 更改名称,然后尝试启动。
I'm not aware of a tool or an automated way of doing this, but I have successfully done this by hand as described above. 我不知道执行此操作的工具或自动方式,但是如上所述,我已经成功地手动完成了此操作。
Did you reconfigure IIS Express? 您是否重新配置了IIS Express? On the project propertis, on the web tab, click "Create Virtual Directory" 在项目属性的Web选项卡上,单击“创建虚拟目录”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.