How do I execute tests in Debug mode using .Net Core and VSCode?
I am currently running the following on the command line:
dotnet Test
However, this is not executing the tests in debug mode.
Do I attach a debugger?
If so... How?
To start debugging: In the Visual Studio editor, set a breakpoint in one or more test methods that you want to debug. Because test methods can run in any order, set breakpoints in all the test methods that you want to debug. In Test Explorer, select the test method(s) and then choose Debug on the right-click menu.
Once you have your launch configuration set, start your debug session with F5. Alternatively, you can run your configuration through the Command Palette (Ctrl+Shift+P) by filtering on Debug: Select and Start Debugging or typing 'debug ' and selecting the configuration you want to debug.
Open the Debug view by selecting the Debugging icon on the left side menu. Select the green arrow at the top of the pane, next to . NET Core Launch (console). Other ways to start the program in debugging mode are by pressing F5 or choosing Run > Start Debugging from the menu.
<TargetFramework>netcoreapp2.0</TargetFramework>
// C# class Program { static void Main(string[] args) { } }
// F# module Program = [<EntryPoint>] let main(args: string[]) = 0
In the main, call the test that you want to debug.
Run the console application in the debugger (usually pressing F5).
This should have no effect on running dotnet test
.
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