[英]Visual Studio adds a number to the project name in solution explorer
I have a solution file with a bunch of projects inside it. 我有一个包含大量项目的解决方案文件。 One of the projects is a Web Site Project .
其中一个项目是网站项目 。 I was going to upgrade from VS2012 to VS2013, and simply opened the .sln file in VS2013.
我打算从VS2012升级到VS2013,只需在VS2013中打开.sln文件。
It does work , but for some reason VS renames the project so that it is displayed in the solution explorer as "NormalNameForProject(1)" with the (1) being the strange part added. 它确实有效 ,但由于某种原因,VS重命名项目,使其在解决方案资源管理器中显示为“NormalNameForProject(1)”,其中(1)是添加的奇怪部分。 How come this?
怎么会这样?
I can look inside the actual .sln file and see that it indeed has the (1) added, but where does it come from and why is it added? 我可以查看实际的.sln文件,看看它确实添加了(1) ,但它来自哪里,为什么要添加?
I had this when I added a project, removed it and added it again with the same name. 当我添加一个项目,删除它并再次使用相同的名称添加它时,我就有了这个。 I resolved it by editing the IIS config file located here for VS 2015:
我通过编辑VS 2015的IIS配置文件解决了这个问题:
$(solutionDir).vs\\config\\applicationhost.config
$(solutionDir).VS \\设置\\对ApplicationHost.config
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.
VS2013使用IIS Express在本地托管站点,并且它们必须在IIS Express配置文件中具有唯一的名称。 If you have several web projects with the same name, they are renamed to match the name in the config file for IIS Express.
如果您有多个具有相同名称的Web项目,则会重命名它们以匹配IIS Express的配置文件中的名称。
That's my best guess. 这是我最好的猜测。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.