Why is IIS 8.0 Express using the old project names after rename in Visual Studio 2012

狂风中的少年 提交于 2019-12-04 11:28:20

The problem isn't in the Project at all.

In the applicationhost.config file (iis.net link), typically in

(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).

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. 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? On the project propertis, on the web tab, click "Create Virtual Directory"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!