简体   繁体   English

为什么IIS 8.0 Express在Visual Studio 2012中重命名后使用旧项目名称

[英]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: 我们已更改:

  • the Project Names 项目名称
  • the Assembly Name, Default namespace, Title and Product entries in the Project Properties 项目属性中的程序集名称,默认名称空间,标题和产品条目
  • the namespaces for each code file in each project that was renamed 重命名的每个项目中每个代码文件的名称空间
  • all the using statements for the revised namespaces 修改后的名称空间的所有using语句
  • cleared out the old .dll files in the /bin directory (for the routing engine to not find multiple controllers) 清除/ bin目录中的旧.dll文件(以使路由引擎无法找到多个控制器)
  • the actual folders themselves, requiring removing and re-adding the projects to the solution (and re-doing references to the projects that were renamed) 实际的文件夹本身,需要将项目删除并重新添加到解决方案中(并重新引用对已重命名的项目)

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.

相关问题 如何使用Visual Studio 2012在IIS 8.0中部署WCF Web服务? - How to deploy a WCF web service in IIS 8.0 using Visual Studio 2012? Visual Studio 2012 + IIS 8.0 =如何在本地主机上部署WCF服务? - Visual Studio 2012 + IIS 8.0 = how to deploy WCF service on localhost? 通过Visual Studio 2012使用IIS Express时,无法识别resx更改 - When using IIS Express through Visual Studio 2012, resx changes are not recognized Windows phone 8.0 sdk visual studio 2012 - Windows phone 8.0 sdk visual studio 2012 带有EDMX的Visual Studio 2012 Web Express编译项目 - Visual Studio 2012 Web Express Compile Project with EDMX 使用Visual Studio项目模板重命名类 - Rename classes using Visual Studio Project Template 此项目(Visual Studio 2012 express)与Visual Studio 2013 express的当前版本不兼容 - This project(Visual Studio 2012 express) is incompatible with the current version of Visual Studio 2013 express Visual Studio 2012 Express C#为什么没有“使用组织”菜单选项? - Visual Studio 2012 Express C# Why do I have no “Organize Using” menu option? 在Visual Studio 2012中进行调试时将IIS Express更改为全功能IIS - Change IIS Express to full functions IIS when debug in Visual Studio 2012 扩展Visual Studio 2012 Express - Extending Visual Studio 2012 Express
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM