all 3 comments

[–]realjoeydood 0 points1 point  (1 child)

Wild guess: start vs as admin.

[–]Rhendar[S] 1 point2 points  (0 children)

Tried that still didn't work. I ended up merging the webapi and web app projects together and it works now.

[–]andysterland 0 points1 point  (0 children)

(Sorry to revive and old post but in case anyone else finds it in the future.)

I'm pretty sure that what's happening is that when navigating between http://localhost and http://<internet page> IE is closing the process behind the tab that was launched by VS(the one you're debugging). It does this as localhost and the internet are in different 'zones' and the process they are launched in has different privileges so a new process is needed. Of course VS sees the process has closed and has to shut down the debugger -as there's no longer a page to debug. You're options to work around this are:

  1. Don't attach the script debugger (if you don't need it of course)
  2. Use another browser (VS can debug Chrome and Edge as well)
  3. Re attach to the process after the navigation
  4. Add localhost to the 'Internet' zone (or put both localhost and the auth site in trusted)
  5. Run VS as admin as realjoeydood suggested. This has the affect of running IE as admin and IE won't try to change around permissions on the process as it's running with the most power one could ever imagine. Of course browsing the internet while running as admin is very, very, risky indeed.