4

So in Visual Studio 2012 I renamed a website in a solution from "oldname" to "newname". I have opened this solution in Visual Studio 2013 and somehow it is using "oldname" for the website instead of "newname". This is not is NOT an ASP.NET website application just an ASP.NET website.

I have searched the content of all files in the solution directory and cannot find "oldname". I am 100% positive that that "oldname" is not in the .sln file and the website does not have a project file of course.

2
  • If you mean a web site "project" (File->New Web Site), then you have found yet another reason to not use them. No project - no name. Dec 22, 2013 at 19:35
  • Oh @JohnSaunders we have had this discussion before haven't we lol ;). Dec 22, 2013 at 20:03

3 Answers 3

21

Check %userprofile%\documents\iisexpress\config\applicationhost.config file. It suspect it should have the old name. Rename the website in the file, close your solution and open it back again.

1
  • Correcta Mundo! Thanks Dec 22, 2013 at 20:06
6

This is how I managed to do it with my solution in Visual Studio 2015:

Close your solution > navigate to .sln-folder > .vs (hidden) > config enter image description here

Look for error prone names (possible multiples) in the sites section. I removed every <site></site> where there were naming conflicts. In my case I had this for example: enter image description here

After removing the <site></site>-sections from the current applicationhost.config-file I was able to re-add website projects with my new and correct name!

1
  • This worked for VS2022 Jul 29, 2022 at 6:14
0

It's an old thread but I tried just modifying the applicationhost.config file and closing the solution but it still didn't take.

If this happens to you just remove the site from your solution and then add an existing one from your local IIS instance and you'll see the renamed version there.

You may want to confirm its location before removing the site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.