I'm not able to debug my tests using Resharper-Debug option in my project. I have seen this issue raised by lots of people, but has't come across a solid suggestion which solves my issue. The strange thing is that, if I create a sample project and write a simple unit test, I'm able to debug it without any issues.However when I try to do this in my current project, it simply throws a dialog box saying "Cannot Launch Debugger".I have checked this with my peers, and they does't face this issue :(
Also I don't have any issues while running the test.
It's an XP machine and following is the version of resharper:
JetBrains ReSharper 5.1 C# Edition
Build 5.1.1753.4 on 2010-10-15T15:51:30Licensed to: XXXXXXX
Plugins: none.
Visual Studio 9.0.21022.8.Copyright © 2003–2011 JetBrains s.r.o.. All rights reserved.
Thanks, -M
I occasionally encounter a test that can't be launched with the Resharper debug icon (due to mock objects or 32 vs 64 bit dlls). A solution that works for me is to add an explicit call to launch the debugger in the test
Debugger.Launch();
Then just run the test as normal. When code execution hits that line you get a security popup (pick yes)
then a visual studio choice popup (pick your currently running visual studio).
You'll be dropped into your code in debug mode at the location where you added the Debugger.Launch() line.
Possibly of use to someone stumbling here, specifically, I encountered the error:
---------------------------
ReSharper – Unit Testing
---------------------------
Cannot launch debugger.
Error code: 89710016
Error message: 0
when using R# 8.2 on VS 2013 Pro when attempting to debug NUnit tests.
After finding this link, the issue resolved by changing the NUnit class library project to x86 (Properties -> Build -> Platform Target : x86
)
Instead of changing the build properties of the Project to be x86 (which can impact other team members if working on a team), you can tell Resharper to run the unit tests in a 32 bit process.
Resharper -> Options -> Tools -> Unit Testing ->General -> Default Platform Architecture
Set this to "Force tests to run in 32-bit process"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With