How to debug cake project in vscode?

大憨熊 提交于 2021-02-07 09:11:57

问题


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:


  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
            }
        ]
    }
    
  6. Open your Cake file and add a breakpoint by hitting F9

  7. Hit F5 to start debugging

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

Note VSCode debugging will only work using .NET Core, so any addin / reference must be available for .NET Core.

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



来源:https://stackoverflow.com/questions/41583636/how-to-debug-cake-project-in-vscode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!