Visual Studio在解决方案资源管理器中为项目名称添加一个数字

Jim*_*Aho 3 c# vs-web-site-project visual-studio-2012 visual-studio-2013 sln-file

我有一个包含大量项目的解决方案文件.其中一个项目是网站项目.我打算从VS2012升级到VS2013,只需在VS2013中打开.sln文件.

它确实有效,但由于某种原因,VS重命名项目,使其在解决方案资源管理器中显示为"NormalNameForProject(1)",其中(1)是添加的奇怪部分.怎么会这样?

我可以查看实际的.sln文件,看看它确实添加了(1),但是它来自哪里,为什么要添加?

Ste*_*ene 7

当我添加一个项目,删除它并再次使用相同的名称添加它时,我就有了这个.我通过编辑VS 2015的IIS配置文件解决了这个问题:

$(solutionDir).VS \设置\对ApplicationHost.config

  • 这应该是公认的答案。两者都指向相同的答案,但这更直接。此外,您可能想提及 vs 目录是隐藏的,并且位于 *Projects* 文件夹中。 (2认同)

Ste*_*rup 5

You probably have other (web site) project with the same name. VS2013 uses IIS Express for hosting the sites locally, and they have to have unique names in the IIS Express config file. If you have several web projects with the same name, they are renamed to match the name in the config file for IIS Express.

这是我最好的猜测.