Can't debug .net core unit tests

Answered

I'm loving Rider so far and want to use it as my main development driver but one major issue that's keeping me from using it is the inability to debug unit tests.  I'm putting a breakpoint in the beginning of my XUnit test method, right clicking on the test (either via test explorer or the code method itself), select "Debug Unit Test".  

The unit test executes and I see it loaded the test suite in the debug window, but the test executes (passes or fails as expected) without ever hitting my breakpoint.

Should debugging unit tests with .net core be working yet or is this still on the TODO list?

0
3 comments

Make sure the "debugType" is set to "portable" in project.json. This is required for .NET Core debugging. Rider will prompt for this when doing "normal" debugging, but doesn't prompt when debugging a test.

1
Avatar
Permanently deleted user

 

Yep, that was it!

Thanks!

0

Thanks, this worked for me too.

Since I'm still on NuGet 2, I had to change the setting in my project's csproj file:

<DebugType>portable</DebugType>
0

Please sign in to leave a comment.