Wayback Machine
81 captures
08 Jun 2023 - 17 Jul 2025
Jul AUG Sep
Previous capture 23 Next capture
2022 2023 2024
success
fail
About this capture
COLLECTED BY
Collection: Save Page Now
TIMESTAMPS
loading
The Wayback Machine - https://web.archive.org/web/20230823142006/https://code.visualstudio.com/docs/csharp/get-started
Skip to content  Visual Studio Code
  • Docs
  • Updates
  • Blog
  • API
  • Extensions
  • FAQ
  • Learn
  • Search
  • Search Search
  • Download VS Code Download VS Code Download

Version 1.81 is now available! Read about the new features and fixes from July.

Dismiss this update
'; document.body.appendChild(div.children[0]); } function pushCodingPackEvent(language, os) { let id = `${language}-${os}-coding-pack`; var analytics = window.vscodeAnalytics; analytics && analytics.event( 'click', 'download', id, ); }
  • Overview
  • Setup
    • Overview
    • Linux
    • macOS
    • Windows
    • Raspberry Pi
    • Network
    • Additional Components
    • Enterprise
    • Uninstall
  • Get Started
    • Intro Videos
    • Tips and Tricks
    • User Interface
    • Themes
    • Settings
    • Key Bindings
    • Display Language
    • Telemetry
  • User Guide
    • Basic Editing
    • Extension Marketplace
    • IntelliSense
    • Code Navigation
    • Refactoring
    • AI Tools
    • Debugging
    • VS Code for the Web
    • Tasks
    • Profiles
    • Settings Sync
    • Snippets
    • Emmet
    • Command Line Interface
    • Workspace Trust
    • Multi-root Workspaces
    • Accessibility
  • Source Control
    • Overview
    • Introduction to Git
    • Collaborate on GitHub
    • FAQ
  • Terminal
    • Terminal Basics
    • Terminal Profiles
    • Shell Integration
    • Appearance
    • Advanced
  • Languages
    • Overview
    • JavaScript
    • JSON
    • HTML
    • CSS, SCSS and Less
    • TypeScript
    • Markdown
    • PowerShell
    • C++
    • Java
    • PHP
    • Python
    • Julia
    • R
    • Ruby
    • Rust
    • Go
    • T-SQL
    • C#
    • .NET
    • Polyglot
  • Node.js / JavaScript
    • Working with JavaScript
    • Node.js Tutorial
    • Node.js Debugging
    • Deploy Node.js Apps
    • Browser Debugging
    • Angular Tutorial
    • React Tutorial
    • Vue Tutorial
    • Debugging Recipes
    • Performance Profiling
    • Extensions
  • TypeScript
    • Tutorial
    • Compiling
    • Editing
    • Refactoring
    • Debugging
  • Python
    • Tutorial
    • Editing Code
    • Linting
    • Formatting
    • Debugging
    • Environments
    • Testing
    • Python Interactive
    • Django Tutorial
    • Flask Tutorial
    • Create containers
    • Deploy Python Apps
    • Python in the Web
    • Settings Reference
  • Java
    • Getting Started
    • Navigate and Edit
    • Refactoring
    • Formatting and Linting
    • Project Management
    • Build Tools
    • Run and Debug
    • Testing
    • Spring Boot
    • Application Servers
    • Deploy Java Apps
    • GUI Applications
    • Extensions
    • FAQ
  • C++
    • Intro Videos
    • GCC on Linux
    • GCC on Windows
    • GCC on Windows Subsystem for Linux
    • Clang on macOS
    • Microsoft C++ on Windows
    • Build with CMake
    • CMake Tools on Linux
    • Editing
    • Debugging
    • Configure debugging
    • Settings
    • Configure IntelliSense for cross-compiling
    • FAQ
  • C#
    • Get Started
    • Navigate and Edit
    • IntelliCode
    • Refactoring
    • Formatting and Linting
    • Project Management
    • Build Tools
    • Package Management
    • Run and Debug
    • Testing
    • FAQ
  • Docker
    • Overview
    • Node.js
    • Python
    • ASP.NET Core
    • Debug
    • Docker Compose
    • Registries
    • Deploy to Azure
    • Choose a dev environment
    • Customize
    • Develop with Kubernetes
    • Tips and Tricks
  • Data Science
    • Overview
    • Jupyter Notebooks
    • Data Science Tutorial
    • Python Interactive
    • PyTorch Support
    • Azure Machine Learning
    • Manage Jupyter Kernels
    • Jupyter Notebooks on the web
  • Azure
    • Extensions
    • Deployment
    • Remote Debugging for Node.js
    • Docker
    • MongoDB
    • Kubernetes
    • Azure Kubernetes Service
  • Remote
    • Overview
    • SSH
    • Dev Containers
    • Windows Subsystem for Linux
    • GitHub Codespaces
    • VS Code Server
    • Tunnels
    • SSH Tutorial
    • WSL Tutorial
    • Tips and Tricks
    • FAQ
  • Dev Containers
    • Overview
    • Tutorial
    • Attach to Container
    • Create a Dev Container
    • Advanced Containers
    • devcontainer.json
    • Dev Container CLI
    • Tips and Tricks
    • FAQ
Edit

Getting Started with C# in VS Code

This getting started guide introduces you to C# and .NET for Visual Studio Code through the following tasks:

  1. Installing and setting up your VS Code environment for C#.
  2. Writing and running a simple "Hello World" application using C#.
  3. Introduce you to other learning resources for C# in VS Code.

Keep in mind, that this guide won't teach you C#. Instead, it teaches you how to get set up for C# development in VS Code. If you're looking for resources to learn C#, check out our C# curriculum.

Learn C# Curriculum

Necessary tools

  • Visual Studio Code
  • C# Dev Kit extension
  • For .NET Development, the .NET SDK

Install

Installing VS Code and extensions

  1. If you haven't already done so, install VS Code.
  2. Next, install C# Dev Kit from the Visual Studio Marketplace. For additional details on installing extensions, read Extension Marketplace. The C# extension is called C# Dev Kit and it's published by Microsoft.

Note: C# Dev Kit supports cloud native development. To do cross-platform mobile and desktop development, you can use C# Dev Kit with the .NET MAUI extension. Learn how to get set up with .NET MAUI in VS Code.

Upon installation, C# Dev Kit launches an extension walkthrough. You can follow the steps of this walkthrough to learn more about the features of the C# extension. Reopen the walkthrough at any time by opening the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)) and selecting Welcome: Open Walkthrough. Here, select Get Started with C# Dev Kit.

C# Dev Kit introductory walkthrough

Note: You are required to sign in to a Visual Studio subscription to use C# Dev Kit. Check out the Signing in to C# Dev Kit documentation to learn more.

Installing the .NET Coding Pack for students

If you're a student, we recommend installing the .NET Coding Pack for an easier setup experience. The Coding Pack includes VS Code, the .NET SDK, and essential .NET extensions. The Coding Pack can be used as a clean installation, or to update or repair an existing development environment.

Install the .NET Coding Pack - Windows

Install the .NET Coding Pack - macOS

Note: The .NET Coding Pack is only available for Windows and macOS. For other operating systems, you need to manually install the .NET SDK, VS Code, and .NET extensions.

Open folder

By starting VS Code in a folder, that folder becomes your "workspace". VS Code stores settings that are specific to that workspace in .vscode/settings.json, which are separate from user settings that are stored globally.

Using a terminal, create an empty folder called "hello", navigate into it, and open VS Code (code) in that folder (.) by entering the following commands:

mkdir hello
cd hello
code .

Alternatively, you can run VS Code through the operating system UI, then use File > Open Folder to open the project folder.

Create a Hello World app

First, ensure you are within the new folder (workspace) that you created. From here, you can create the project in two ways.

Use the Command Palette

  1. Bring up the Command Palette using ⇧⌘P (Windows, Linux Ctrl+Shift+P) and then type ".NET".
  2. Find and select the .NET: New Project command.
  3. After selecting the command, you'll need to choose the project template. Choose Console app.
  4. To run your app, select Run > Start Debugging in the upper menu, or use the F5 keyboard shortcut. To learn more about debugging your C# project, read the debugging documentation.

Use the Command Palette to create a new .NET project

Use the terminal

  1. Open a terminal/command prompt and navigate to the folder in which you'd like to create the app. Enter the following command in the command shell:

    dotnet new console
    
  2. When the project folder is first opened in VS Code:

    A "Required assets to build and debug are missing. Add them?" notification appears at the bottom right of the window.

    Select Yes.

  3. Run the app by entering the following command in the command shell:

    dotnet run
    

Learn more

Explore all the features the C# extension has to offer by looking for .NET in the Command Palette. For more information on these features, refer to the other documentation pages.

For learning materials on C# and .NET, check out the following resources:

  1. Learn to program using C#
  2. Learn to build with .NET in VS Code
  3. Learn to build web applications

Join the community

Find community resources and connect with user groups.

.NET developer community - Meet with like-minded developers

7/11/2023

In this article there are 6 sectionsIn this article

  • Necessary tools
  • Install
  • Open folder
  • Create a Hello World app
  • Learn more
  • Join the community
  • Hello from Seattle.
  • Follow @code
  • Support
  • Privacy
  • Manage Cookies
  • Terms of Use
  • License
Microsoft homepage Microsoft homepage © 2023 Microsoft