20

I deleted an old ASP.NET Web Application project called nPower.Ignition.WebResponsive from my solution in Visual Studio, but when I added a new Web Site project in the same spot, I saw (1) appended at the end of my desired name. I tried to delete and recreate a few more times, and now I'm to the point where it looks like this in my solution explorer, with (3) appended on the end of my desired name!

enter image description here

So... I pretty much know what caused this, but not how to fix it.

Is Visual Studio remembering that I used to have a project with that name in my solution, even though I've deleted it, and trying to avoid a conflict by giving it a different name? Is there a way I can get rid of the number appended at the end? I understand it probably won't make much of a difference from a programming standpoint if I leave the name as is, but it looks quite sloppy!

3
  • My speculation is that inside the solution folder on the hard drive the folders for the deleted projects still exist. When you try to create a new project, it detects that the folder name it taken, so is adding an incrementing number to find a unique name. If I'm right, simply deleting these folders should fix it. Commented Jul 31, 2014 at 20:49
  • Well there isn't any old folder for the deleted projects--I manually deleted them. But yeah, that was what I thought may have caused it. Commented Jul 31, 2014 at 20:54
  • 1
    Feels funny to do this to my own question but, it's a duplicate of Completely deleting Visual Studio website solutions Commented Jul 31, 2014 at 20:59

3 Answers 3

44

This occurs because each time you create a Web Site project using IIS Express, VS adds a new entry to IIS Express' applicationhost.config (C:\Users\YourName\Documents\IISExpress\config\applicationhost.config). Each website needs to be unique, so VS will append and increment the number following the name.

To get rid of this, you need to clear out the conflicting entries in the applicationhost.config file.

In more recent versions of Visual Studio, the applicationhost.config file is located in the .vs\config folder under the solution file.

Sign up to request clarification or add additional context in comments.

6 Comments

Yep! That's got to be it. And I just realized my question is a duplicate of this one: stackoverflow.com/questions/20067377/…
I actually deleted the C:\Users\YourName\Documents\IISExpress and when I opened my website the first time, the (1) appeared in the file name
Also check your project applicationhost.config file in .vs/config. stackoverflow.com/a/34716590/1467810
4 YEARS LATER (10-Mar-2018) - Using Visual Studio 2017 v15.6.1 -- this solution does not work -- there is NO matching entry in the C:\Users\YourName\Documents\IISExpress\config\applicationhost.config file -- now what?
@bdcoder the applicationhost.config file now exists for each solution under .vs\config. However, we still get the extra (1) showing up, so I opened a feedback ticket. Feel free to vote it up: developercommunity.visualstudio.com/content/problem/212349/…
|
0

I believe what is happening is that when you delete it from VS, some part is remaining on your hard disk, either the SLN file or the folder. So, when you create a new one, it sees it already exists and adds the number.

Comments

0

After having my computer's hard disk replaced by a SSD (with the use of a disk cloning tool), my VS 2015 weirdly stopped executing automatically as administrator, and since the defined website port was 1000, it no more had permission to use that port. Hence, it was always creating an identical entry in $(SolutionDir).vs\config\applicationhost.config, just to set a new port (above 50000). Only when I configured it to start as administrator again, I was able to open the solution without having the website renamed to "___(1)".

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.