.NET Core launch.json 简介

1.环境 Windows,.NET Core 2.0,VS Code

dotnet> dotnet new console -o myApp

2.launch.json配置文件

{
   // 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}/myApp/bin/Debug/netcoreapp2.0/myApp.dll",
            "args": [],
            "cwd": "${workspaceFolder}/myApp",
            // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
            "console": "internalConsole",
            "stopAtEntry": false,
            "internalConsoleOptions": "openOnSessionStart"
        },
        {
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach",
            "processId": "${command:pickProcess}"
        }
    ,]
}

在launch.json中

name:配置名称,在启动配置下拉菜单中显示
type:配置类型
request:请求配置类型(一般为launch或attach)运行或附加
preLaunchTask:调试会话前要运行的任务
program:程序Build以后生成的dll,默认是${workspaceFolder}/bin/Debug/(target-framework)/(project-name.dll)
workspaceFolder:正在调试的程序的工作目录的路径。默认为当前工作区(即使用Code命令进入的目录)
target-framework:框架
args:传递给程序的命令行参数
cwd:项目目录
console:启动调试目标的位置
stopAtEntry:调试器是否在目标的入口点停止,默认为 false
internalConsoleOptions:内部调试控制台的控制行为
processId:要附加到的进程 id。使用  "$ {command:pickProcess}" 以获取要附加到的正在运行的进程的列表。如果使用 "processId", 则不应使用 "processName"。
注:在.NET Core 1.0版本中
externalConsole:Console单独启动配置,开发console时,如果需要输入后调试,将值设置为true,将console单独启动即可。

转载于:https://www.cnblogs.com/htsg/p/9221164.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值