Question

I'm trying to debug my unit tests (xunit) under Visual Studio 2012 (via Test Explorer -> Debug Selected Test). But I can't step into my code of target library. In Modules window I see, what my library symbols are loaded, and the symbol file is found. But in "User Code" column it marked as "N/A" (like all other libraries, include running test library). Project in Debug configuration isn't optimized, just xml documentation file generation is defined.

How to make VS determine my libraries as "user code" in debug mode?

Was it helpful?

Solution

Solved! Problem was in code. I'm using method which return IEnumerable<> via yield return, and I just call this method (without any iterations on results). So because of yield returns specifics actually this method wasn't called.

So, be careful with yield returns! It may lead to "strange" behaviour like this one :)

OTHER TIPS

I was having this same issue but noticed that my build was targeting "Release" instead of "Debug".

Interesting, since I click on "debug selected tests" I hope it will get debugged, not simply ran on selected build.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top