在Visual Studio Code中使用C#以及.net core

Working with C#

Installing C# support

C# language support is an optional install from the Marketplace. You can install it from within VS Code by searching for 'C#' in the Extensions view (Ctrl+Shift+X) or if you already have a project with C# files, VS Code will prompt you to install the extension as soon as you open a C# file.

Video Tutorial on Getting Started with C# in VS Code with .NET Core

In addition to the Microsoft C# extension, the community has produced other extensions.

 

Roslyn and OmniSharp

Visual Studio Code uses the power of Roslyn and OmniSharp to offer an enhanced C# experience. We offer support for:

  • .NET Core projects
  • MSBuild projects
  • C# scripts (CSX)

On startup the best matching projects are loaded automatically but you can also choose your projects manually. The status bar will show what projects have been loaded and also allows you to select a different set of projects. To do so, click on the status bar projects item and select Change projects…. In the image below a single project has been picked up:

 

The available options include:

  • Selecting a project.json file will open a .NET Core project and VS Code will load that project plus the referenced projects.
  • Selecting a *.sln file opens a MSBuild-project. It will load the referenced *.csproj projects and sibling or descendant project.json files but no other project files that are referenced from the solution file.
  • Selecting a folder will make VS Code scan for *.sln, project.json and *.csx files (C# scripts) and VS Code will attempt to load them all.

Once the project is loaded the enhanced experiences light up...

 

 

 

 

 

 

Using .NET Core in Visual Studio Code

 Note: VS Code does not support debugging applications running on the Desktop .NET Framework.

Due to this focus, many standard C# project types are not recognized by VS Code.

An example of a non-supported project type is an ASP.NET MVC Application (though ASP.NET Core is supported).

In these cases, if you want to have a lightweight tool to edit a file - VS Code has you covered.

If you want the best possible experience for those projects and development on Windows in general, we recommend you use Visual Studio Community.

作者:Chuck Lu    GitHub    
posted @   ChuckLu  阅读(1677)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2015-10-23 CruiseControl.net
2015-10-23 求职
2014-10-23 object Add(object Before, object After, object Count, object Type);
2014-10-23 Excel中Application和ApplicationClass的区别
2014-10-23 Type.Missing和System.Reflection.Missing.Value
2014-10-23 excel依赖的dll
点击右上角即可分享
微信分享提示