请提供使用VS Code在未安装Visual Studio 2015的机器上进行Cake项目调试的步骤。我在Cake文档中找不到任何调试步骤。
Create file .vscode/launch.json and add the following content (assuming your Cake file is build.cake)
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"program": "${workspaceRoot}/tools/Cake.CoreCLR/Cake.dll",
"args": [
"${workspaceRoot}/build.cake",
"--debug",
"--verbosity=diagnostic"
],
"cwd": "${workspaceRoot}",
"stopAtEntry": true,
"externalConsole": false
}
]
}
Open your Cake file and add a breakpoint by hitting F9
这段内容摘自Cake网站上Martin Björkström的一篇深入的博客文章:http://cakebuild.net/blog/2016/09/debug-cake-vscode
需要注意的是,VSCode只能用于.NET Core调试,因此任何插件或引用必须可用于.NET Core。
如果要调试标准的.NET Cake,请使用Visual Studio,Gary Ewan Park在这篇博客文章中进行了描述:http://cakebuild.net/blog/2016/05/debug-cake-file