-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debugging unit tests always uses coreclr launch, even for non-coreclr project #1586
Comments
@AHelper Do you know if the unit test worker process will run as a 32-bit or 64-bit process when using desktop CLR? |
@gregg-miskelly 64-bit process. |
@AHelper in that case, this sounds pretty easy to do via unitTestDebuggingOptions if needed. @DustinCampbell would OmniSharp know what framework a test is supposed to run in? |
@DustinCampbell would OmniSharp know what framework a test is supposed to run in? Or should I just allow 'type' to be set like AHelper suggested. |
Today, there's no input that tells us what the TargetFramework is unless it's specified in the project. |
Okay, I will make a tweak to let 'type' be settable. |
To be clear, if there's a single TargetFramework, we can do the right thing in OmniSharp. However, there's a further experience that needs built around having a switcher for TargetFramework, similar to Debug|Release, x86|x64, etc. |
This checkin allows the unit test debugging options to set 'type'. This resolves dotnet#1586.
@AHelper I created a fix for you. Can you give it a try and verify it actually works end-to-end for your scenario?
|
Actually, hold up one sec. I accidentally included more changes than I wanted to in that .vsix. |
This checkin allows the unit test debugging options to set 'type'. This resolves dotnet#1586.
Okay, .zip updated. This should now work. |
Just got to testing this on my end, the fix works perfectly, thanks! |
Great! This fix will ship in 1.12. |
Environment data
dotnet --info
output:VS Code version:
1.13.1
C# Extension version:
1.10.0
Steps to reproduce
Using example.zip as base net46 xunit workspace:
Set a breakpoint on Console.WriteLine line in Test method
Click
debug test
on Test methodExpected behavior
Breakpoint should be hit
Actual behavior
Breakpoint is missed, the debug launch uses a coreclr configuration and vsdbg outputs
Looking at https://github.com/OmniSharp/omnisharp-vscode/blob/master/src/features/dotnetTest.ts#L116 the launch configuration generated has the type hard-coded to "coreclr" while this assumption may be (and in this case is) invalid. It appears that the csharp.unitTestDebuggingOptions setting is used as a basis for the launch configuration, but the type is set after the fact.
Manually setting the type to "clr" in the extension allows the debugger to properly attach to the process and debugging works as expected.
I'm not sure about the effort required to auto-detect the launch type, however a suitable workaround would be to allow type to be specified in unitTestDebuggingOptions.
The text was updated successfully, but these errors were encountered: