If you stumbled upon this post it most likely mean that you're having some issues trying to rename a ASP.NET Web Site within a Visual Studio solution. As you might already know, ASP.NET Web Sites don't have the "rename" option when you right-click on them like ASP.NET Web Applications and almost any other project template: as a matter of fact, they cannot be renamed using the GUI - if you want to change their name, you have to manually edit something outside Visual Studio.
That "something" changes depending on which version of Visual Studio you're using.
Visual Studio 2013 (and below)
In order to rename the web site you need to open the IIS Express configuration file and change the <site> section of your Web Site project:
- Locate the applicationHost.config file of your IIS Express: it should be in the C:\Users\{username}\Documents\IISExpress\config folder.
- Locate the corresponding <site> section of your project within that file.
- Rename the old website name, putting the new name instead. If you prefer, you can also delete that <site> section entirely, as it will be re-created on first use.
- Close and Reopen your solution in Visual Studio.
As soon as you do that, you'll found that the spefic name for your web project come back!
Visual Studio 2015 (and above)
The workaround for Visual Studio 2015, 2017, 2019 and (most likely) above is basically the same of VS2013, with a small difference: the IIS Express configuration path has been changed, they moved it away from the Windows user folder (smart move) and put it into a dedicated .vs\ folder within the main Solution folder.
The new path should be something like that:
- {Solution}\.vs\config\applicationhost.config
Have it open, locate the old name and replace it (or delete the <site> section), then restart Visual Studio and you'll be good to go.
Conclusion
That's it for now: I hope that this post will be useful enough for those web developers who need to rename their ASP.NET Web Sites.
I followed your steps (I’m using VS 2017), and I failed in my first attempt!
I found it that if the localhost address is not right in the Site config you want to keep, VS won’t accept the change.
For example, I had a previous value that I wanted to keep, but it had an old localhost address. And the value I wanted to delete had the current one.