Debugging Console App and Web API App from Visual Studio 2010

garfbradaz

Problem

I have a Visual Studio 2010 solution that contains various class library projects, 1 ASP.NET Web API project and 2 Console Application projects.

Now the console applications use the WebClient class to communicate with the Web API project I have within the Solution. When I run one of the console applications, the Web API is automatically run within the VS ASP.NET WebDev Server (within Localhost). This is fine. When I set breakpoints within the Web API solution (say one of the controllers), they are not hit during debugging. Only the console breakpoints are hit. Now if I run the Web API solution directly, and use something like REST Easy FF addon to build the request, the breakpoints are hit.

Is there a option in Visual Studio 2010 to break across two different applications at once when debugging?

Technology I'm using

  1. Visual Studio 2010 SP1
  2. Console applications are .NET 4.0 projects
  3. Web API project is the 1st release
DeJaVo

I can think of several methods to cope with your question:

  1. explicitly load the symbols from Solution A: go to Tools->Options->Debugging->Symbols you can point it at the .pdb file from Solution A. Then you can see if the symbols are loaded from your binaries by going to Debug->Windows->Modules while debugging.
  2. Disable the Debugging feature named "Just My Code". This is a feature aimed at minimizing the debugging experience to just the code in your solution. In order to disable it:

Tools -> Options -> Debugging

Unchecked "Enable Just My Code"

  1. Last option is using the solution I've found in a different question someone posted:

Here is what I did.

Say a project from solution A refers a project from Solution B and I want to debug into solution B project from Solution A project.

Open Solution B in Visual Studio. Set the project properties to "Use Local IIS Wb Server", set the project Url and create Virtual Directory.

Open Solution A in another Visual Studio Instance. Set the project properties to "Use Local IIS Wb Server" and Check "Use IIS Express", set the project Url and create Virtual Directory.

Press F5 and start debugging Solution B instance of Visual Studio. Then Press F5 and start debugging Solution A instance of Visual Studio. Now both the instances of Visual Studio will be in debug mode. Start from Solution A now and you should be able to debug into Solution B just like if both projects were in the same solution.

The key here is to "Use IIS express" for one and "Local IIS Web server" for the other project. This will let you have two debuggers running at once.

Source: https://stackoverflow.com/a/25630033/3125120

I hope it helps.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to add a web service reference in Visual Studio 2015 to a console app

From Dev

Debugging with visual studio multi-threaded app

From Dev

Debugging x64 Web Application in Visual Studio 2010

From Dev

Debugging Web Application on Visual Studio 2010 after Deployment

From Dev

Debugging Web Application on Visual Studio 2010 after Deployment

From Java

What is going wrong with web deployment from Visual Studio and App service?

From Dev

Prevent Visual Studio 2013 from opening web app after publish

From Dev

How to Kill a script in Visual Studio Console App

From Dev

Debugging API in browser and Android app in emulator same time on one Visual Studio

From Dev

Unable to start debugging in Visual Studio RTM for cordova app

From Dev

Debugging WebApi in Visual Studio returns no response to MVC app

From Dev

Debugging Cordova App (android) with Visual Studio 2015 New Emulator

From Dev

Debugging a node app hosted on a VM using Visual Studio Code

From Dev

Unable to start debugging in Visual Studio RTM for cordova app

From Dev

Debugging Appcelerator Windows Phone App with Visual Studio 2015

From Dev

GUI Debugging server app using Visual Studio Code

From Dev

Visual Studio Cannot Publish Web App

From Dev

Launch Client Console App from Web Page

From Dev

C# console app hangs when removed from Visual Studio directory

From Dev

ASP.NET Web API help pages in Visual Studio 2010

From Java

How can I prevent Visual Studio 2013 from closing my IIS Express app when I end debugging?

From Dev

Visual Studio C# Console App (.NET Core) Template Different

From Dev

Is releasing app from Visual Studio safe?

From Dev

Migrating MFC app from Visual Studio 2012 to Visual Studio 2013

From Dev

Migrating MFC app from Visual Studio 2012 to Visual Studio 2013

From Dev

use existing SSRS Reports in a Visual C# app using Visual Studio 2010

From Dev

Httpclient consume web api via console app C#

From Dev

Is there a way in Visual Studio to configure the default start page for web deployment starting from Empty ASP.NET Web App?

From Java

App.Config Transformation for projects which are not Web Projects in Visual Studio?

Related Related

  1. 1

    How to add a web service reference in Visual Studio 2015 to a console app

  2. 2

    Debugging with visual studio multi-threaded app

  3. 3

    Debugging x64 Web Application in Visual Studio 2010

  4. 4

    Debugging Web Application on Visual Studio 2010 after Deployment

  5. 5

    Debugging Web Application on Visual Studio 2010 after Deployment

  6. 6

    What is going wrong with web deployment from Visual Studio and App service?

  7. 7

    Prevent Visual Studio 2013 from opening web app after publish

  8. 8

    How to Kill a script in Visual Studio Console App

  9. 9

    Debugging API in browser and Android app in emulator same time on one Visual Studio

  10. 10

    Unable to start debugging in Visual Studio RTM for cordova app

  11. 11

    Debugging WebApi in Visual Studio returns no response to MVC app

  12. 12

    Debugging Cordova App (android) with Visual Studio 2015 New Emulator

  13. 13

    Debugging a node app hosted on a VM using Visual Studio Code

  14. 14

    Unable to start debugging in Visual Studio RTM for cordova app

  15. 15

    Debugging Appcelerator Windows Phone App with Visual Studio 2015

  16. 16

    GUI Debugging server app using Visual Studio Code

  17. 17

    Visual Studio Cannot Publish Web App

  18. 18

    Launch Client Console App from Web Page

  19. 19

    C# console app hangs when removed from Visual Studio directory

  20. 20

    ASP.NET Web API help pages in Visual Studio 2010

  21. 21

    How can I prevent Visual Studio 2013 from closing my IIS Express app when I end debugging?

  22. 22

    Visual Studio C# Console App (.NET Core) Template Different

  23. 23

    Is releasing app from Visual Studio safe?

  24. 24

    Migrating MFC app from Visual Studio 2012 to Visual Studio 2013

  25. 25

    Migrating MFC app from Visual Studio 2012 to Visual Studio 2013

  26. 26

    use existing SSRS Reports in a Visual C# app using Visual Studio 2010

  27. 27

    Httpclient consume web api via console app C#

  28. 28

    Is there a way in Visual Studio to configure the default start page for web deployment starting from Empty ASP.NET Web App?

  29. 29

    App.Config Transformation for projects which are not Web Projects in Visual Studio?

HotTag

Archive