Attach To Web Service Process
-
I have two copies of VS 2010 open. In one I'm running a MVC 4 Web API on localhost. In the second I'm running some code that calls the WEB API. Is it possible to step into the WebAPI's process so I can run the back end data code? I tried to attach to the first instance of VS, but it doesn't work.
If it's not broken, fix it until it is
-
I have two copies of VS 2010 open. In one I'm running a MVC 4 Web API on localhost. In the second I'm running some code that calls the WEB API. Is it possible to step into the WebAPI's process so I can run the back end data code? I tried to attach to the first instance of VS, but it doesn't work.
If it's not broken, fix it until it is
Wait. You're running each app in separate instances of VS? Set breakpoint in your MVC and Web API code wherever you need to poke around and run. So what's the problem? This is exactly how it's done. You run your MVC app in one instance of VS and your Web API in the other.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
Wait. You're running each app in separate instances of VS? Set breakpoint in your MVC and Web API code wherever you need to poke around and run. So what's the problem? This is exactly how it's done. You run your MVC app in one instance of VS and your Web API in the other.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave KreskowiakDave Kreskowiak wrote:
Wait. You're running each app in separate instances of VS?
This confuses you? They're two different solutions. Lemme explain... The first app contains the WebAPI, as well as the UI, proxy, etc.. Now I'm working on a second app that has to call the same Web API. I will be making changes in the DAL, which is part of the API, for this second app.. So, I open the solution with the API in it, and run the API so now the development server is running. Next I open the second app and want to make calls into the API. But since they're separate apps in separate solutions, how does my second app step into the API so I can debug?
If it's not broken, fix it until it is
-
Dave Kreskowiak wrote:
Wait. You're running each app in separate instances of VS?
This confuses you? They're two different solutions. Lemme explain... The first app contains the WebAPI, as well as the UI, proxy, etc.. Now I'm working on a second app that has to call the same Web API. I will be making changes in the DAL, which is part of the API, for this second app.. So, I open the solution with the API in it, and run the API so now the development server is running. Next I open the second app and want to make calls into the API. But since they're separate apps in separate solutions, how does my second app step into the API so I can debug?
If it's not broken, fix it until it is
Kevin Marois wrote:
This confuses you? They're two different solutions.
No. The point of your question confuses me. You're already doing it!
Kevin Marois wrote:
But since they're separate apps in separate solutions, how does my second app step into the API so I can debug?
It doesn't! You run the API app in it's own copy of VS and it handles all the debugging on that side. VS can only debug one app at a time. If you're already go it in another VS, what's the frickin' problem?!
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
Kevin Marois wrote:
This confuses you? They're two different solutions.
No. The point of your question confuses me. You're already doing it!
Kevin Marois wrote:
But since they're separate apps in separate solutions, how does my second app step into the API so I can debug?
It doesn't! You run the API app in it's own copy of VS and it handles all the debugging on that side. VS can only debug one app at a time. If you're already go it in another VS, what's the frickin' problem?!
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave KreskowiakDave Kreskowiak wrote:
No. The point of your question confuses me. You're already doing it!
Clearly you don't understand what I'm asking, because if I were already doing it, I wouldn't be asking... So let me break it down some more. Application A's solution contains an MVC 4 Web API. I open the solution and run the API. Server starts, all's OK. Next I open ANOTHER solution with Application B. App B needs to use the same WebAPI being run in solution A. I want to STEP INTO THE CODE in the API from within APP B. I've tried to Attach to both the Web Sever and to APP A's Visual Studio instance, but I when I can't debug the API. Breakpoints don't get hit. I've done this before at a company I once worked for, so I know it can be done. I just can't figure out why it won't work here.
If it's not broken, fix it until it is
-
Dave Kreskowiak wrote:
No. The point of your question confuses me. You're already doing it!
Clearly you don't understand what I'm asking, because if I were already doing it, I wouldn't be asking... So let me break it down some more. Application A's solution contains an MVC 4 Web API. I open the solution and run the API. Server starts, all's OK. Next I open ANOTHER solution with Application B. App B needs to use the same WebAPI being run in solution A. I want to STEP INTO THE CODE in the API from within APP B. I've tried to Attach to both the Web Sever and to APP A's Visual Studio instance, but I when I can't debug the API. Breakpoints don't get hit. I've done this before at a company I once worked for, so I know it can be done. I just can't figure out why it won't work here.
If it's not broken, fix it until it is
Kevin Marois wrote:
Clearly you don't understand what I'm asking
I assure you, I do. I've never gotten it to work, so that's why I use two separate instances of VS.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
Kevin Marois wrote:
Clearly you don't understand what I'm asking
I assure you, I do. I've never gotten it to work, so that's why I use two separate instances of VS.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave KreskowiakDave Kreskowiak wrote:
I've never gotten it to work
so what does
Dave Kreskowiak wrote:
I use two separate instances of VS
do for you? how do you debug that API if you can't get it to work. You just contradicted yourself.
If it's not broken, fix it until it is
-
Dave Kreskowiak wrote:
No. The point of your question confuses me. You're already doing it!
Clearly you don't understand what I'm asking, because if I were already doing it, I wouldn't be asking... So let me break it down some more. Application A's solution contains an MVC 4 Web API. I open the solution and run the API. Server starts, all's OK. Next I open ANOTHER solution with Application B. App B needs to use the same WebAPI being run in solution A. I want to STEP INTO THE CODE in the API from within APP B. I've tried to Attach to both the Web Sever and to APP A's Visual Studio instance, but I when I can't debug the API. Breakpoints don't get hit. I've done this before at a company I once worked for, so I know it can be done. I just can't figure out why it won't work here.
If it's not broken, fix it until it is
Kevin Marois wrote:
I want to STEP INTO THE CODE in the API from within APP B.
I think this is the issue, I set a second break point at the entry point of the call to the web api instance. You can't step from 1 instance to another AFAIK.
Never underestimate the power of human stupidity RAH
-
Dave Kreskowiak wrote:
I've never gotten it to work
so what does
Dave Kreskowiak wrote:
I use two separate instances of VS
do for you? how do you debug that API if you can't get it to work. You just contradicted yourself.
If it's not broken, fix it until it is
No I didn't. Run the Web API project in one instance of VS and I run the client project in another. Each instance is debugging only a single process. No problems at all. All breakpoints set in each respective project gets hit and shows up in the instance of VS that's running that project.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
No I didn't. Run the Web API project in one instance of VS and I run the client project in another. Each instance is debugging only a single process. No problems at all. All breakpoints set in each respective project gets hit and shows up in the instance of VS that's running that project.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave KreskowiakOK, this may be the problem. When I set a breakpoint in the API and run the code in the second app, the breakpoint in the first app never gets hit. I was under the assumption that I needed to attached to the API's process to step into it.
If it's not broken, fix it until it is