为什么聘用VS Code?VS Code 是一款跨平台的代码剪辑器,思思他的哥哥VS,并是微软出品的天地第一IDE,那看成VS的弟弟巨屌 twitter,VS Code 也不会差,毕竟微软出品。归正ken是这样以为的
本篇确立环境?1、操作系统: Windows 10 X642、SDK: .NET Core 2.0 Preview3、VS Code:1.14
前置常识?请看第2篇教程
二、装配&确立1、VS Code 下载&装配(1)下载地址:https://code.visualstudio.com/(2)装配环节:一直下一步即可,没什么相等隆重的
2、依赖的package
package装配高歌施展 c# ext install csharp 包括语法高亮袒露、智能感知、界说、查找所有援用等。调试复旧。收罗中枢(CoreCLR)。快捷键:Ctrl P ,然后输入:ext install csharp 即可装配三、相貌创建&确立 1、创建相貌
#使用高歌教导符(cmd)冒昧Windows PowerShell #1、翻开相貌文献夹 d: && cd d:\projects #2、创建相貌 dotnet new console -n helloworld2、驱动确立
(1)翻开相貌文献夹
图片巨屌 twitter
(2)必须插件装配翻开资源处分器(Ctrl Shift E),然后翻开Progrom.cs文献VS Code检测到枯竭两个插件OmniSharp,.NET Core Debugger 会自动下载装配
图片
装配完成后的圆善输出:
Updating C# dependencies... Platform: win32, x86_64 Downloading package 'OmniSharp (.NET 4.6 / x64)' (15622 KB) .................... Done! Downloading package '.NET Core Debugger (Windows / x64)' (43510 KB) .................... Done! Installing package 'OmniSharp (.NET 4.6 / x64)' Installing package '.NET Core Debugger (Windows / x64)' Finished
(3)添加编译&调试确立
插件装配兑现之后,VS Code会教导枯竭必要的编译&调试确立,是否添加,聘用Yes即可
图片
飘雪影院在线神马影院(4)启动调试
快捷键F5径直启动调试即可
通过调试面板(Ctrl Shift D)图形化操作也可
调试输出遵循:
------------------------------------------------------------------- You may only use the Microsoft .NET Core Debugger (vsdbg) with Visual Studio Code, Visual Studio or Visual Studio for Mac software to help you develop and test your applications. ------------------------------------------------------------------- Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.0.0-preview2-25407-01\System.Private.CoreLib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. Loaded 'd:\Projects\helloworld\bin\Debug\netcoreapp2.0\helloworld.dll'. Symbols loaded. Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.0.0-preview2-25407-01\System.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.0.0-preview2-25407-01\System.Console.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.0.0-preview2-25407-01\System.Threading.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.0.0-preview2-25407-01\System.Runtime.Extensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. Hello World! The program '[4180] helloworld.dll' has exited with code 0 (0x0).备注
毕竟是微软的用具 微软的SDK,衔尾起来是蛮便捷的比起 .NET Core 1.0 刚出来的时期(毕竟其时VS Code也节略)巨屌 twitter,少了许多环节。是真是爽。.NET Core 搞起来~
系列称号:.NET Core 快速初学教程 上一篇:.NET Core快速初学教程 3、我的第一个.NET Core App (CentOS篇) 下一篇:.NET Core快速初学教程 5、使用VS Code进行C#代码调试的时代 本篇初度发布:2017-07-16 本篇原文聚会:https://ken.io/note/dotnet-core-qucikstart-debug-vscode 本站仅提供存储工作,所有践诺均由用户发布,如发现存害或侵权践诺,请点击举报。