如何在vscode中调试Cake项目? [英] How to debug cake project in vscode?
问题描述
请在未安装Visual Studio 2015的计算机中提供带有VS Code的蛋糕项目调试步骤.我在cake文档中找不到任何调试步骤.
Please provide cake project debugging steps with VS Code in Visual Studio 2015 not installed machine. I could not find any debugging steps in cake documentation.
推荐答案
- 将Cake.CoreCLR NuGet软件包安装到工具文件夹中
- 为Visual Studio代码安装Cake Extension
- 在Visual Studio Code中设置.NET Core调试器.有关详细信息,请参见 http://aka.ms/vscclrdebugger
- 在Visual Studio Code中打开包含Cake文件的目录
-
创建文件.vscode/launch.json并添加以下内容(假设您的Cake文件是build.cake)
- Install Cake.CoreCLR NuGet package to your tools folder
- Install Cake Extension for Visual Studio Code
- Set up .NET Core debugger in Visual Studio Code. See http://aka.ms/vscclrdebugger for details
- Open the directory containing your Cake files in Visual Studio Code
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
}
]
}
打开Cake文件并按F9键添加一个断点
Open your Cake file and add a breakpoint by hitting F9
这摘自MartinBjörkström在Cake网站上的精彩深度博客文章 http://cakebuild.net/blog/2016/09/debug-cake-vscode
This is taken from an excellent in-depth blog post by Martin Björkström on Cake's website http://cakebuild.net/blog/2016/09/debug-cake-vscode
注意VSCode调试仅在.NET Core上有效,因此任何addin/引用都必须可用于.NET Core.
Note VSCode debugging will only work using .NET Core, so any addin / reference must be available for .NET Core.
要调试标准的标准.NET Cake,请使用Visual Studio,这在本博客中由Gary Ewan Park进行了描述. http://cakebuild.net/blog/2016/05/debug-cake-file
For debugging standard standard .NET Cake use Visual Studio, which is described in this blog post by Gary Ewan Park http://cakebuild.net/blog/2016/05/debug-cake-file
这篇关于如何在vscode中调试Cake项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!