Debugging MSTest Unittests in Visual Studio Code

后端 未结 4 1626
南方客
南方客 2021-01-19 01:46

I am trying to use Visual Studio Code to Debug a MSTest unit test project. But the tests just run and the breakpoint is never reached.

Here is my launch.json:

<
4条回答
  •  再見小時候
    2021-01-19 02:20

    Try https://github.com/Microsoft/vstest-docs/blob/master/docs/diagnose.md#debug-test-platform-components (assumes you're using dotnet-cli tools 1.0.0)

    > set VSTEST_HOST_DEBUG=1
    > dotnet test
    # Process will wait for attach
    # Set breakpoint in vscode
    # Use the NETCore attach config from vscode and pick the dotnet process
    

提交回复
热议问题