我正在尝试使用 Visual Studio Code 调试 MSTest 单元测试项目。但测试只是运行并且从未到达断点。
这是我的 launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Test (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "C:\\Program Files\\dotnet\\dotnet.exe",
"args": ["test"],
"cwd": "${workspaceRoot}",
"console": "internalConsole",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
如何调试单元测试 (MSTest)? XUnit 也存在同样的问题。
最佳答案
关于在 Visual Studio Code 中调试 MSTest 单元测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43210794/