Kev*_*vin 5 testing .net-core visual-studio-code
很抱歉在这里发帖,但我环顾了整个互联网,找不到任何东西。
我正在尝试使用扩展“.NET Core 测试资源管理器”在 VSCode 中调试我的单元测试。
我可以很好地运行测试,但我无法调试它们 - 这是输出:
Test run for Gameboy.Tests.MMUTests.Memory_ValidateBytes_WithSuccess, expecting 1 test results file(s) in total
Executing dotnet build in /Users/kevin/Repos/NetCore GameBoy/Gameboy.Tests/
Executing dotnet test --no-build --logger "trx;LogFileName=/var/folders/6d/p11jk7052lx2m4_fj5vk6qwc0000gn/T/test-explorer-sw7Rdk/0.trx" --filter "FullyQualifiedName=Gameboy.Tests.MMUTests.Memory_ValidateBytes_WithSuccess" in /Users/kevin/Repos/NetCore GameBoy/Gameboy.Tests/
Process 4345 started
Waiting for debugger to attach
Waiting for debugger to attach
Waiting for debugger to attach
Waiting for debugger to attach
Waiting for debugger to attach
Waiting for debugger to attach
Waiting for debugger to attach
Run Code Online (Sandbox Code Playgroud)
基本上,我想它永远不允许调试器附加。即使我手动附加到上述 PID,使用此任务:
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
Run Code Online (Sandbox Code Playgroud)
在我的测试中它仍然没有达到我的断点。
任何帮助,将不胜感激。
这是tasks.json 和launch.json 的完整输出
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/Gameboy.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/Gameboy.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"${workspaceFolder}/Gameboy.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
}
]
}
Run Code Online (Sandbox Code Playgroud)
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/Gameboy.dll",
"args": [],
"cwd": "${workspaceFolder}",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1142 次 |
| 最近记录: |