Skip to main content

C# Development in Cursor: Dev Kit Setup Guide

C# Dev Kit in Cursor

C# and .NET development in Cursor is absolutely viable, but it requires some setup. The C# Dev Kit extension brings Visual Studio-like tooling into Cursor, and with the right configuration, you get IntelliSense, debugging, project scaffolding, and more. This guide covers everything you need based on community experience from the 35-reply discussion thread.

Prerequisites

Before installing the C# Dev Kit, make sure you have:

  1. Cursor installed (version 0.40 or later recommended)
  2. .NET SDK installed (download from dotnet.microsoft.com)
  3. A basic understanding of C# and .NET project structure

Verify your .NET installation:

dotnet --version

You should see a version number like 8.0.100 or 9.0.100. If this fails, install the .NET SDK first.

Installing the C# Dev Kit Extension

Step 1: Open the Extensions Panel

In Cursor, press Ctrl+Shift+X (or Cmd+Shift+X on macOS) to open the Extensions marketplace.

Step 2: Search for C# Dev Kit

Type C# Dev Kit in the search box. Look for the official Microsoft extension:

Publisher: Microsoft
Extension ID: ms-dotnettools.csdevkit

Step 3: Install

Click Install. Cursor will download and install the extension along with its dependencies:

  • C# extension (IntelliSense, syntax highlighting)
  • .NET Install Tool
  • IntelliCode for C# Dev Kit
tip

If the install button is grayed out or the extension doesn't appear, make sure Cursor is up to date. Some older Cursor versions have compatibility issues with the latest C# Dev Kit.

Step 4: Reload Cursor

After installation completes, you'll see a prompt to reload the window. Click Reload to activate the extension.

Setting Up Your First .NET Project

Creating a New Project

With the C# Dev Kit installed, you have several ways to create a project.

Option 1: Using the Command Palette

  1. Press Ctrl+Shift+P (or Cmd+Shift+P)
  2. Type .NET: New Project
  3. Select a project template (Console App, Web API, Class Library, etc.)
  4. Choose a location and name for your project

Option 2: Using the Terminal

# Create a new console application
dotnet new console -n MyCursorApp

# Navigate into the project
cd MyCursorApp

# Open in Cursor
cursor .

Option 3: Using the Solution Explorer

The C# Dev Kit adds a Solution Explorer panel to Cursor. You can right-click in the empty space and select Create New Project.

Project Structure

A typical .NET console project looks like this:

MyCursorApp/
├── MyCursorApp.csproj # Project file with dependencies
├── Program.cs # Entry point
└── obj/ # Build artifacts (auto-generated)

The .csproj file is where you manage NuGet packages and project settings:

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
Target Framework

Use net8.0 for Long Term Support (LTS) or net9.0 for the latest features. The C# Dev Kit supports both.

Adding NuGet Packages

You can add packages through the Solution Explorer or the terminal:

# Add Entity Framework Core
dotnet add package Microsoft.EntityFrameworkCore.SqlServer

# Add Newtonsoft.Json
dotnet add package Newtonsoft.Json

# Add ASP.NET Core
dotnet add package Microsoft.AspNetCore.App

Debugging C# in Cursor

Debugging is where the C# Dev Kit really shines. You get breakpoints, step-through debugging, variable inspection, and call stack navigation.

Launch Configuration

The first time you press F5 to debug, Cursor will prompt you to create a launch.json file. Select .NET Core from the dropdown.

This creates .vscode/launch.json:

{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/net8.0/MyCursorApp.dll",
"args": [],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}

You'll also need .vscode/tasks.json for the build task:

{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/MyCursorApp.csproj"
],
"problemMatcher": "$msCompile"
}
]
}

Setting Breakpoints

Click in the gutter next to any line number to set a breakpoint. The C# Dev Kit supports:

  • Standard breakpoints
  • Conditional breakpoints (right-click the breakpoint)
  • Logpoints (breakpoints that log without stopping)

Debugging Features

FeatureHow to AccessNotes
Start debuggingF5Runs with the debugger attached
Step overF10Execute current line, move to next
Step intoF11Enter function calls
Step outShift+F11Return from current function
Watch variablesDebug panel > WatchAdd expressions to monitor
Call stackDebug panel > Call StackNavigate the execution stack
Inspect variablesHover over variableInline value display
tip

If debugging doesn't start, check that the program path in launch.json matches your actual output DLL path. The path changes if you rename your project or change the target framework.

VS Code Extension Compatibility

Cursor is built on VS Code, so most VS Code extensions work out of the box. However, there are some nuances with the C# ecosystem.

Extensions That Work Well

ExtensionPurposeStatus
C# Dev KitCore C# toolingFully supported
IntelliCode for C# Dev KitAI-assisted completionsWorks
.NET Install ToolSDK managementWorks
NuGet GalleryPackage browsingWorks
REST ClientAPI testingWorks

Known Compatibility Issues

Some users in the community thread reported occasional issues:

  1. Solution Explorer not loading: Sometimes the Solution Explorer panel stays empty. Fix: reload the window (Ctrl+Shift+P > Developer: Reload Window).

  2. IntelliSense delays: On large solutions, IntelliSense can take a few seconds to initialize. This is normal for the first load.

  3. Test Explorer: The built-in test explorer sometimes doesn't discover tests immediately. Run dotnet test from the terminal as a fallback.

# Run all tests
dotnet test

# Run tests with verbose output
dotnet test --verbosity normal

# Run a specific test class
dotnet test --filter "FullyQualifiedName~MyTestClass"

Using Additional VS Code Extensions

You can install other VS Code extensions that complement C# development:

  • GitLens -- enhanced Git integration
  • Error Lens -- inline error display
  • Bracket Pair Colorizer -- visual bracket matching
  • XML Tools -- for editing .csproj and .config files

Working with ASP.NET Core

The C# Dev Kit fully supports ASP.NET Core projects. Here's a quick setup:

# Create a new Web API project
dotnet new webapi -n MyApi
cd MyApi
cursor .

The Solution Explorer will show your controllers, models, and configuration files. Debugging works the same way -- press F5 and the API will launch with the debugger attached.

For Web API projects, you may want to update launch.json to use the integrated terminal:

{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/net8.0/MyApi.dll",
"args": [],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}

Best Practices for C# in Cursor

1. Use .editorconfig

Create an .editorconfig file in your project root to enforce consistent formatting:

root = true

[*.cs]
indent_style = space
indent_size = 4
csharp_new_line_before_open_brace = all
csharp_prefer_braces = true
dotnet_sort_system_directives_first = true

2. Configure OmniSharp Settings

If you need to tweak the C# language server, add settings to Cursor's settings.json:

{
"omnisharp.enableRoslynAnalyzers": true,
"omnisharp.enableEditorConfigSupport": true,
"omnisharp.organizeImportsOnFormat": true
}

3. Leverage Cursor's AI with C#

Cursor's AI features work great with C#. Some effective prompts:

"Generate a repository pattern implementation for this Entity 
Framework Core model with async CRUD operations."

"Refactor this controller to use MediatR commands instead of
direct service calls."

"Add input validation using FluentValidation for this DTO class."

4. Keep Your SDK Updated

The C# Dev Kit works best with recent .NET SDK versions. Check for updates regularly:

dotnet --list-sdks
dotnet --version

5. Use Solution Files for Multi-Project Setups

For solutions with multiple projects, create a .sln file:

dotnet new sln -n MySolution
dotnet sln add MyApi/MyApi.csproj
dotnet sln add MyApi.Tests/MyApi.Tests.csproj

The C# Dev Kit's Solution Explorer will display all projects and their dependencies.

Troubleshooting Common Issues

IssueSolution
"No .NET SDK found"Install the .NET SDK and restart Cursor
IntelliSense not workingReload window or check OmniSharp logs (Ctrl+Shift+P > OmniSharp: Show Output)
Build fails with missing referencesRun dotnet restore in the terminal
Debugger won't attachVerify launch.json program path matches output DLL
Slow startup on large solutionsExclude bin/ and obj/ folders from file watching in settings
warning

If you see repeated crashes of the C# language server, try disabling other extensions temporarily to isolate conflicts. The C# Dev Kit can conflict with older extensions that also register C# language providers.

Summary

C# development in Cursor is production-ready once you install the C# Dev Kit and configure your project correctly. You get full IntelliSense, debugging, project management, and NuGet package support. The workflow is close to Visual Studio but with Cursor's AI features layered on top.

Key takeaways:

  • Install the official Microsoft C# Dev Kit extension
  • Use dotnet new or the Solution Explorer to scaffold projects
  • Configure launch.json and tasks.json for debugging
  • Keep your .NET SDK updated for best compatibility
  • Use .editorconfig for consistent code style

With this setup, Cursor becomes a powerful IDE for .NET development, combining Microsoft's C# tooling with Cursor's AI-assisted coding features.