Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Run & Debug Single C# FilesNew to Visual Studio Code? Get it now.
Run & Debug Single C# Files

Run & Debug Single C# Files

Lev4ik

|
2 installs
| (1) | Free
Run and debug single .cs files without configuring csproj or solution. Manage .NET frameworks and NuGet packages.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

CSSingleRun: Run & Debug Single C# Files

A Visual Studio Code extension for running, debugging, and exporting single C# files—no .csproj or solution required. Each open file gets its own isolated temp project with full .NET and NuGet support.

Features

  • Run & Debug Single C# Files

    • Instantly run or debug any standalone .cs file with no project setup required
    • Each open C# file gets its own isolated temp project/session
    • Breakpoints work as expected in the active editor
  • .NET Framework Selection

    • Choose from installed .NET SDKs/runtimes for each session
  • NuGet Package Management

    • Search NuGet.org live, add/remove packages per file session
    • View installed packages for the current file
  • Export as Project

    • Export the current session (code, csproj, packages) as a portable .NET project
  • Automatic Cleanup

    • Temp projects are cleaned up when files/VS Code are closed
  • Multi-file Support

    • Open and manage multiple C# files independently; all commands operate on the focused file

Usage

  • Right-click a .cs file or use the Command Palette to access all features under the CSSingleRun submenu
  • Hotkeys (in C# files):
    • Ctrl+Alt+R — Run
    • Ctrl+Alt+D — Debug
    • Ctrl+Alt+F — Select Framework
    • Ctrl+Alt+N — Manage Packages
    • Ctrl+Alt+Shift+N — Remove Package
    • Ctrl+Alt+I — Show Session Info
    • Ctrl+Alt+E — Export as Project

Requirements

  • .NET SDK installed and available in PATH
  • For debugging: C# Dev Kit or C# extension (for CoreCLR debug support)

For more details, see the in-extension help or open an issue for support.

The extension automatically detects installed .NET frameworks. No additional configuration needed.

Error Handling

  • No .NET Found: Install .NET SDK from https://dotnet.microsoft.com/download
  • Network Errors: Check internet connection for NuGet package search
  • Package Errors: Ensure package is compatible with selected framework

Troubleshooting

Extension not activating

  • Ensure you have a .cs file open
  • Check that VS Code version is 1.75.0 or later

Cannot find .NET

  • Verify .NET SDK is installed: dotnet --version
  • Ensure dotnet CLI is in your PATH

Package search not working

  • Check internet connection
  • Try a different package name
  • NuGet service may be temporarily unavailable

Development

See DEVELOPMENT.md for contributor guidelines.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft