网站301跳转代码,广告联盟哪个比较好,安卓网站开发视频,网站自动秒收录工具Visual Studio作为宇宙第一的IDE#xff0c;开发调试.net core app#xff0c;无一能出其右#xff0c;我们还需要去了解Visual Studio Code吗#xff1f;答案是肯定。杀鸡焉用牛刀#xff1a;就一个hello world的Console App#xff0c;还需要打开Visual Studio吗#… Visual Studio作为宇宙第一的IDE开发调试.net core app无一能出其右我们还需要去了解Visual Studio Code吗答案是肯定。杀鸡焉用牛刀就一个hello world的Console App还需要打开Visual Studio吗画地为牢如果开发环境换成Ubuntu或Centos等任意一个Linux发行版调试怎么办兵贵神速马上就要开始调试一个已有app但是调试环境没有Visual Studio安装是不是特别费时甚至不支持Visual Studio,怎么办那么Visual Studio Code的小而美的优势就会体现出来。1.安装Visual Studio Code 纯属混字数的扔一个链接https://code.visualstudio.com/下载去吧windows下就是傻瓜式下一步下一步。红帽系linuxhttps://code.visualstudio.com/docs/setup/linux#_rhel-fedora-and-centos-based-distributionsdebian或者ubuntuhttps://code.visualstudio.com/docs/setup/linux#_debian-and-ubuntu-based-distributionsMacOShttps://code.visualstudio.com/docs/setup/mac2.安装.net core sdk 同样是扔一个链接https://dotnet.microsoft.com/download页面选项卡有4种环境WindowsLinuxMacOSDocker按需选择吧3.编码 略过4.调试配置 假设你已经编码完成F5开始调试-Select Envoriment-.net core4.1 生成并修改launch.json然后就会创建.vscode文件夹且创建了launch.json{// Use IntelliSense to learn about possible attributes.// Hover to view descriptions of existing attributes.// For more information, visit: https://go.microsoft.com/fwlink/?linkid830387version: 0.2.0,configurations: [{name: .NET Core Launch (web),type: coreclr,request: launch,preLaunchTask: build,program: ${workspaceFolder}/Vmware.Sphere.Api/bin/Debug/netcoreapp3.1/properties/netcoreapp3.1/Vmware.Sphere.Api.dll,args: [],cwd: ${workspaceFolder}/Vmware.Sphere.Api,stopAtEntry: false,serverReadyAction: {action: openExternally,pattern: \\bNow listening on:\\s(https?://\\S)},env: {ASPNETCORE_ENVIRONMENT: Development},sourceFileMap: {/Views: ${workspaceFolder}/Views}},{name: .NET Core Attach,type: coreclr,request: attach,processId: ${command:pickProcess}}]
}
program:调试的dll路径cwd:正在调试的程序的工作目录的路径。默认是当前工作区其他属性还想知道具体作用鼠标悬停在launch.json的某一个属性上就可以了解并根据实际情况进行修改。4.2 生成task.jsonF5-Could not find the task build-Configure Task-Select a task to configure-Create task.json file from temple-.Net Core就会继续在.vscode下创建task.json{// See https://go.microsoft.com/fwlink/?LinkId733558// for the documentation about the tasks.json formatversion: 2.0.0,tasks: [{label: build,command: dotnet,type: shell,args: [build,// Ask dotnet build to generate full paths for file names./property:GenerateFullPathstrue,// Do not generate summary otherwise it leads to duplicate errors in Problems panel/consoleloggerparameters:NoSummary],group: build,presentation: {reveal: silent},problemMatcher: $msCompile}]
}
preLaunchTask:build,Task to run before debug session starts.在启动调试会话之前运行的任务说白了就是调试之前总得构建生成吧。然后就会触发task中lable名为build的构建任务commandargsdotnet build ...5.调试快捷键 Continue / Pause F5Step Over F10Step Into F11Step Out ShiftF11Restart CtrlShiftF5Stop ShiftF5Run (Start Without Debugging) action is triggered with CtrlF5现在就可以正常调试了断点日志断点变量监控等等参考链接 https://code.visualstudio.com/docs/editor/debugging#_launch-configurations长按二维码关注点外卖先领券