views:

114

answers:

2

I have a solution file containing multiple web applications and components. Mostly these web applications operate independently of one another, but I need to be able to response.redirect from one application to another. This works, and the new page runs, but I can't step into the code in the second web app and debug it.

I have both web applications set to "Always Start When Debugging" = True, with the first web app (the one that's redirecting) set as the startup web application. Does anyone know a trick that will let me step into the code in the second web application?

A: 

Are both web applications running in the same process? What version of ASP.Net, IIS, and the .Net framework are you using? Those are my initial questions before I start giving other ideas.

JB King
That worked! Or at least inspired me to do this - open two instances of Visual Studio, and set each one to run a different web app at startup. The redirect sent me to the second instance of Visual Studio and I was able to step into the code. Thanks!
Amanda Waterman
UGH, sorry, I commented on the wrong answer...
Amanda Waterman
+2  A: 

Open up a second instance of Visual Studio, then Ctrl+Alt+P (menu Tools > Attach to Process) then attach to the appropriate web server process (if you run under IIS this may be w3wp.exe or aspnet_wp IIRC, if you use the built in web server then attach to the process which lists the appropriate port for your project).

Optionally just run the second one and manually go to the first one in your browser by entering the appropriate address and trigger the redirect which you have verified is working.

cfeduke
That worked! Or at least inspired me to do this - open two instances of Visual Studio, and set each one to run a different web app at startup. The redirect sent me to the second instance of Visual Studio and I was able to step into the code. Thanks!
Amanda Waterman
Great. I find myself Ctrl+Alt+P all the time and never running (F5) my application from VS. For larger apps it can save a lot of time since you can keep a browser open and logged into the page you are working on and just refresh or repost after fixing a bug and rebuilding.
cfeduke
I am going to have to try that too... sometimes building takes so long, I find myself popping over to Gizmodo to kill 60 seconds, and then 60 seconds becomes ten minutes, and why did I start this thing up again? Good tip.
Amanda Waterman