简体   繁体   English

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

[英]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.

相关问题 Visual Studio 2008:添加的项目未显示在解决方案资源管理器中 - Visual Studio 2008: Added Project not showing up in Solution Explorer Visual Studio 解决方案资源管理器未在解决方案中显示项目 - Visual Studio Solution Explorer not showing projects in solution 如何通过Visual Studio插件获取Visual Studio Project(在解决方案资源管理器中加载)的位置? - How to get Visual Studio Project (which is loaded in solution explorer) location via a Visual Studio Addin? 如何从 Visual Studio Package 项目中获取当前的解决方案名称? - How to get the current solution name from a Visual Studio Package project? 如何在 Visual Studio 中更改整个解决方案的项目名称? - How to change whole solution's project's name in Visual Studio? 解决方案资源管理器中的 Visual Studio 2017 锁定文件 - Visual Studio 2017 lock file in solution explorer 配置文件未出现在 Visual Studio 的解决方案资源管理器中 - Config file not appearing in solution explorer in visual studio Visual Studio 2013扩展解决方案资源管理器筛选器 - Visual Studio 2013 Extending Solution Explorer Filter 没有解决方案资源管理器现在显示 Visual Studio - No Solution explorer now showing Visual Studio Visual Studio .Net解决方案资源管理器图标 - Visual Studio .Net Solution Explorer icons
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM