01. VS Code Setup for .NET Development
Level: Beginner
- Install VS Code lightweight editor
- Essential C# and .NET extensions
- Configure for .NET debugging
- Built-in terminal for CLI commands
- Git integration and REST testing
- Set up SMS project in VS Code
The Problem
Visual Studio is powerful but heavy (5GB). VS Code is lightweight, fast, and extensible. Many .NET developers use VS Code for quick edits, API testing, Git management, and CLI work. You should know both tools.
Install VS Code
Download from: https://code.visualstudio.com
Install and open.
Essential Extensions
Press Ctrl + Shift + X (Extensions):
Search and install:
C# Development:
- C# (OmniSharp)
- C# Extensions
- .NET Extension Pack
Productivity:
- Git Graph
- REST Client
- SQL Server (mssql)
- Prettier
Debugging:
- Debugger for .NET
Install all. Reload VS Code.
Configure C#
Create .vscode/settings.json:
{
"omnisharp.enableEditorConfigSupport": true,
"omnisharp.enableAnalyzersSupport": true,
"omnisharp.enableRoslynAnalyzers": true,
"[csharp]": {
"editor.defaultFormatter": "ms-dotnettools.csharp",
"editor.formatOnSave": true
}
}
Auto-format on save.
Open Project Folder
File → Open Folder → SMS (project root)
VS Code detects C# project.
Integrated Terminal
Ctrl + ` (backtick) opens terminal:
dotnet build
dotnet run
dotnet test
Terminal in editor window.
Debug Setup
Create .vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/bin/Debug/net8.0/SMS.dll",
"args": [],
"stopAtEntry": false,
"console": "integratedTerminal"
}
]
}
Click Run (or F5) to debug.
Key Shortcuts
| Shortcut | Action |
|---|---|
Ctrl + K, Ctrl + C | Comment |
Ctrl + Shift + P | Command Palette |
Ctrl + / | Toggle comment |
Alt + Up/Down | Move line |
F5 | Debug |
| `Ctrl + `` | Terminal |
SMS Project in VS Code
SMS/
├── src/
│ ├── SMS.Core/
│ ├── SMS.Data/
│ └── SMS.Api/
├── tests/
├── .vscode/
│ ├── settings.json
│ └── launch.json
└── SMS.sln
Lightweight, productive development.
Key Takeaways
- VS Code = lightweight editor
- Extensions = add .NET support
- Terminal = run commands
- Debug = step through code
Use REST Client extension to test APIs without Postman.
Use ChatGPT, Claude, or Copilot to go deeper on VS Code Setup. Try these prompts:
"What extensions do I need for C#?""How do I debug in VS Code?""How do I run dotnet commands?""Quiz me on VS Code"
💡 Tip: After reading this article, paste your own code into AI and ask "What could go wrong here and why?" — fastest way to find edge cases and deepen understanding.