Visual Studio adds a number to the project name in solution explorer
Asked Answered
F

2

7

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.

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. 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?

Fistulous answered 7/1, 2015 at 10:6 Comment(0)
V
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.

That's my best guess.

Vaas answered 7/1, 2015 at 10:24 Comment(3)
I only have one web site project in the solution. I'm not using IIS Express, but instead IIS7.5 locally. Visual Studio however automatically adds a UseIISExpress = True attribute which i'd like to remove.Fistulous
Yes, in that solution, no other web sites in other solutions? And VS will add it to the IIS Express config anyway. Why are you using IIS ? Instead of IIS Express?Wiper
I only have one solution that I have opened, so I think that part is fine. However, I realized that when I first opened my solution in VS2013, a default port number was added, which was not the same as the one specified in the config file for IIS Express, hence yet another entry had to be made. That's what I suspect so far.Fistulous
W
14

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:

$(solutionDir).vs\config\applicationhost.config

Weiler answered 3/4, 2016 at 16:42 Comment(2)
I tried all the other solutions, but this fixed it. ThanksAnthelmintic
This should be the accepted answer. Both point to the same answer but this is much more direct. Also, you may want to mention that the vs directory is hidden and in the Projects folder.Mosquito
V
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.

That's my best guess.

Vaas answered 7/1, 2015 at 10:24 Comment(3)
I only have one web site project in the solution. I'm not using IIS Express, but instead IIS7.5 locally. Visual Studio however automatically adds a UseIISExpress = True attribute which i'd like to remove.Fistulous
Yes, in that solution, no other web sites in other solutions? And VS will add it to the IIS Express config anyway. Why are you using IIS ? Instead of IIS Express?Wiper
I only have one solution that I have opened, so I think that part is fine. However, I realized that when I first opened my solution in VS2013, a default port number was added, which was not the same as the one specified in the config file for IIS Express, hence yet another entry had to be made. That's what I suspect so far.Fistulous

© 2022 - 2024 — McMap. All rights reserved.