-
Notifications
You must be signed in to change notification settings - Fork 684
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
Enable coreclr debugger to lunch dotnet commands #252
Comments
|
got it. thanks. |
Does this mean that there is a way to debug xunit tests in VsCode? |
@seesharper : You can debug any .NET Core RC2+ program you want in VS Code. However, there is no child process debugging. So if the program spawns the code in a child process (like 'dotnet test' does) - it isn't going to work. If you run xunit directly through - yes, that will work. |
Which would mean invoking the xunit.runner.console.exe directly? |
If xunit.runner.console.exe is a native CoreCLR host (ex: it is just corehost.exe renamed) then yes. Otherwise - no, you would need to launch some sort of CoreCLR host executable. I am not a super expert on this subject, but the two hosts that come with the .NET CLI are -- 'dotnet.exe ' and corehost.exe. CoreHost.exe works like this - you copy it next to a managed entry point dll (ex: if you want to run c:\example\bin\debug\example.dll, copy it to c:\example\bin\debug\example.exe) it will then look for a dll next to itself. The CLI uses a 'deps' file to use these. |
Thanks a lot for valuable information. I managed to get it working with a native CoreCLR console app where I simply new up the test classes and manually invoke the test method.
This approach is a little cumbersome, but it allows me to "pick" the test method to be executed and I can actually debug the test using vs code. It would be great however, if there was a way to determine the "current" method in the editor. If I knew the name of the test method currently under the cursor I could feed that to the args of my little test wrapper console app (e.g debug current test). |
We have a feature request (#311) to add proper support for 'dotnet test' which I think will solve your problem. If not, the technique we employ when implementing it, you could probably use in your own VS Code extension if you want. But as of now, I think your solution is the best I can think of. |
Today to configure the lunch command for coreclr, users can only specify an assembly.
dotnet
command likedotnet test
is not configurable.This blocks the scenario of run and debugging a dotnet xunit test.
The text was updated successfully, but these errors were encountered: