mardi 7 avril 2015

When debugging unit tests in Visual Studio, is there a way to dynamically attach to a running web application?

I am using Visual Studio 2013 to debug a C# Web API. The Web API code is running autonomously in IIS on my machine (it is not launched by Visual Studio). It lives at localhost\myProject\api\ and takes basic parameters passed by a JavaScript frontend.


I am debugging using a C# Unit Test project that runs server-side and makes calls to the Web API. When I run "debug tests", the tests are started with the debugger, but no symbols for the targeted Web Api are loaded and I need to attach to the Web API process manually every time I run a test.


Is there a way for Visual Studio to dynamically associate Unit Tests with a running application so that I don't need to manually attach the debugger to the corresponding process for every test run?


Aucun commentaire:

Enregistrer un commentaire