如何在vscode中调试Cake项目? [英] How to debug cake project in vscode?

查看:82
本文介绍了如何在vscode中调试Cake项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请在未安装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.

推荐答案

  1. 将Cake.CoreCLR NuGet软件包安装到工具文件夹中
  2. 为Visual Studio代码安装Cake Extension
  3. 在Visual Studio Code中设置.NET Core调试器.有关详细信息,请参见 http://aka.ms/vscclrdebugger
  4. 在Visual Studio Code中打开包含Cake文件的目录
  5. 创建文件.vscode/launch.json并添加以下内容(假设您的Cake文件是build.cake)

  1. Install Cake.CoreCLR NuGet package to your tools folder
  2. Install Cake Extension for Visual Studio Code
  3. Set up .NET Core debugger in Visual Studio Code. See http://aka.ms/vscclrdebugger for details
  4. Open the directory containing your Cake files in Visual Studio Code
  5. 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屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆