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

Chr*_*son 4 c# project iis-express asp.net-mvc-4

在一些命名混乱后,我的团队决定重命名一些项目和项目中所有现有代码文件的命名空间.(在Visual Studio 2012中)

我们改变了:

  • 项目名称
  • 项目属性中的程序集名称,默认名称空间,标题和产品条目
  • 重命名的每个项目中每个代码文件的名称空间
  • 修改后的命名空间的所有using语句
  • 清除/ bin目录中的旧.dll文件(路由引擎找不到多个控制器)
  • 实际文件夹本身,需要删除并重新添加项目到解决方案(并重新引用已重命名的项目)

在完成所有这些之后,IIS 8.0 Express仍然坚持使用旧项目名称作为站点名称(在本地调试时).我怎样才能解决这个问题?

编辑: 真正的问题是:IIS 8.0 Express如何确定网站名称

这是一个剪辑自(.之一)网站的.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>
Run Code Online (Sandbox Code Playgroud)

...而且没有任何网站名称.

Chr*_*son 6

问题根本不在项目中.

在applicationhost.config文件(iis.net链接)中,通常在

(user-dir)\My Documents\IISExpress\config\applicationhost.config

有一个站点的设置.只需更改站点的名称属性即可.

       <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>
Run Code Online (Sandbox Code Playgroud)