Nikola Schou
Nikola Schou

Reputation: 2466

Debug xunit while debugging asp.net project in VS2015

While debugging an ASP.NET Core project in Visual Studio 2015 I can no longer run or debug my xunit tests. This makes it quite difficult to work with integration tests that test the API using http, e.g. by using the HttpClient class or something like that.

Does anyone know why Visual Studio will prevent me from running or debugging an xunit test while debugging the IIS Express or Kestrel web-process? And if anything can be done to run/debug a xunit test while debugging the web project?

Upvotes: 0

Views: 94

Answers (1)

Victor Hurdugaci
Victor Hurdugaci

Reputation: 28425

You can launch multiple Visual Studio instances and attach to the processes that you want to debug. Or you can even attach the same VS instance to multiple processes. The option is in Debug -> Attach to process.

If that doesn't work, launch the tests from a console and attach to that process.

Upvotes: 1

Related Questions