Launch vs Attach: Choosing a .NET Debugging Mode in JetBrains Rider
Decide whether to launch your .NET app under the Rider debugger or attach to a running process, with PDB symbol checks and build-configuration guidance.
20 Feb 2026, 23:12 UTC

The decision: launch under the debugger or attach?
You are debugging a .NET application in JetBrains Rider, and the issue does not appear on the first request. It shows up only after the service has warmed up, inside an already-running IIS worker process, or in a long-running console host you started outside Rider. Pressing the debug button restarts the process and loses the exact state you were investigating.
Useful takeaway: launch the application under the Rider debugger when you need breakpoints at startup, deterministic reproduction, or full control over launch arguments and environment variables. Attach to an already-running process when the process is already executing, hosted outside Rider, or too expensive to restart. In both cases, confirm that matching PDB symbol files are loaded before assuming a breakpoint will suspend execution.
Constraints to check before choosing
- Process ownership: attaching to a process running under a different user account may require elevated permissions or fail outright.
- .NET runtime: the debugger expects a compatible runtime; attaching to a process using a different .NET version can fail.
- Symbols (PDBs): Program Database files map compiled code back to source. Without matching PDBs, breakpoints may not bind.
- Build configuration: Debug builds preserve local variables and avoid most optimizations. Release builds with tiered compilation (a just-in-time feature that replaces quickly generated code with optimized code later) can inline methods and make variables unavailable.
Supported options compared
| Factor | Launch under debugger | Attach to running process |
|---|---|---|
| Typical use | New reproduction, startup logic, unit-scoped debugging | Long-running services, warm-up issues, IIS-hosted apps |
| Environment control | Full: arguments, environment variables, working directory | Inherited from the existing process |
| Rider path | Run > Debug <configuration> (Shift+F9) | Run > Attach to Process |
| Breakpoint accuracy | Best with Debug build and matching PDBs | Same backend, but depends on the running build's symbols |
| State preserved | No; process starts fresh | Yes; process continues from its current state |
Trade-offs
Launching gives you a clean slate. You can set environment variables in the Run/Debug configuration and be certain the debugger is attached from the first line of Main or the application's entry point. The downside is that you lose any in-memory state that existed before the restart.
Attaching preserves state, which is essential for reproducing issues that depend on cached data, open connections, or authenticated sessions. The trade-off is less control: you cannot change the process's command line or environment after the fact, and symbol loading may be slower on the first attach because Rider must locate PDBs for already-loaded modules.
Validation: launch under the debugger
- Open your .NET solution in Rider. Version assumption: Rider 2024.2 or later with the .NET debugger installed; menu paths may differ in older versions.
- Open
Program.csand set a breakpoint on the first executable line by clicking the gutter margin. - Select the correct Run/Debug configuration from the toolbar, then click the Debug icon (bug symbol) or press Shift+F9.
- Expected check: execution suspends at the breakpoint, the Debug tool window opens, and the call stack shows your entry point.
- Where to run: inside Rider. No special permissions are required for a process running under your own user account.
- Risk: if the configuration targets the wrong project or profile, Rider launches a different application than the one you intended to debug.
Validation: attach to a running process
- Start the .NET application without debugging: choose Run > Run Without Debugging, or run
dotnet run --project <ProjectPath>in a terminal. - Note the process ID (PID) from Rider's Processes tool window, Task Manager,
ps, orGet-Process. - In Rider, choose Run > Attach to Process.
- Select the target process from the list and attach.
- Trigger the code path containing your breakpoint.
- Expected check: execution suspends at the breakpoint and the Debug tool window displays locals and the call stack.
- Permissions: attaching to a process owned by another user, or to a protected system process, may require administrator or root privileges. Rider may surface an access-denied error.
- Risk: attaching to the wrong PID or to a process built with a different .NET runtime can produce a failed attach or silent breakpoint misses.
Diagnostic decision: verify symbols in the Modules window
After attaching, do not assume breakpoints are active. Open the Modules tab in the Debug tool window and locate your application assembly.
- If the status shows symbols loaded, breakpoints bound to source lines should hit.
- If the status shows
Cannot find or open the PDB fileor similar, the breakpoint may appear as a hollow circle and will not suspend execution. - Practical check: rebuild the project in Debug configuration, restart or re-attach, and confirm the Modules window reports symbols loaded for the assembly.
Limitations and what to verify
- Release builds with tiered compilation can inline methods, optimize away locals, and shift breakpoint binding. Prefer Debug builds for local debugging.
- First-time symbol loading after an attach can be slow. Wait for the Modules window to finish before judging whether breakpoints will work.
- Attaching across user accounts or to processes under a different .NET runtime may fail; Rider version and runtime compatibility should be confirmed in your environment.
- [Verify] Exact menu names, tool-window labels, and keyboard shortcuts can vary between Rider releases. Confirm them in your installed version before relying on this guide.
Quick checklist
- Need startup breakpoints or controlled arguments? Launch under the debugger.
- Debugging an already-running or warm service? Attach to the process.
- Always use a Debug build with matching PDBs for local debugging.
- Check the Modules window for symbol status after attaching.
- Expect access restrictions when attaching to processes owned by other users.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.