Visual Studio 2012 Launches Wrong Project For Debugging

asp.net, visual-studio-2012

Solution

I have just come across this issue today, having done exactly as you (copied a project, and then edited). And hence i would like to share my solution.

If you go to Project B's `Properties` (found in solution Explorer), you will find a `Web` tab:

In your `Servers` section, alter the `Project Url` to:

`http://localhost:` + (number +1) + `/`

and then hit Create Virtual Directory

You should then be able to re-run your project and since they're running off different Url's, you shouldn't see this clash again.

Problem

I've got an ASP.NET web application project in a Visual Studio 2012 solution. I'll refer to this as A. I copied A's directory to a new directory to make a clone of it. I'll refer to this as B. I made extensive changes to both A and B to the point that they are not even remotely similar. Stylesheets, scripts, HTML, and back end is all different. I launched A for debugging, and it appeared in my browser as expected. I debugged the application for awhile, and then terminated debugging via the "stop debugging" icon on the toolbar within Visual Studio 2012. I then launched B for debugging. Instead, I got A. I tried clearing browser cache, though, this couldn't be the problem because the server side of the application was wrong too. I tried Rebuilding the project, after running Clean. I still see A while trying to debug B. I tried killing all processes related to the debugging session including all iisexpress.exe, MSBuild.exe, WebDev.WebServer40.EXE, Microsoft.VisualStudio.Web.Host.exe instances. I tried closing Visual Studio 2012 completely, reopening it, and retrying debugging. EDIT After closing and reopening VS2012 for a third time, it started now allowing me to see B. Nothing else has changed. Best I can come up with is there must be some type of project setting that needs to be changed to reflect that the project lives in a different space than it did before being copied, but I have yet to track down such a setting. What am I missing?

Original source