What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
When Visual Studio can’t start debugging, first verify the startup project and build result; then follow the error to the right branch. F5 launches the selected startup target under the debugger, but a failed build, an incorrect web launch profile, or a debugger that is not attached can each look like the same problem. The steps below separate those cases without assuming a particular language or project type.
Check the startup target, build, and configuration first
- Select the runnable project. In Solution Explorer, right-click the project that should run and select Set as Startup Project. In a multi-project C# solution, Microsoft says to choose the project containing the program entry point. A class library or DLL may need a calling application or an explicit launch action rather than being started by itself. See Microsoft’s C# run-program guide.
- Check whether the solution builds. Select View > Output and choose the build output, then inspect View > Error List. Visual Studio normally builds before launching, so resolve the first relevant build error, missing dependency, or incompatible target-framework issue before troubleshooting the debugger.
- Choose the Debug configuration. Check the configuration selector on the toolbar and select Debug when you need debugger features. Debug and Release are separate configurations; Release is optimized for performance. See Microsoft’s explanation of debugging.
- Start the selected target. Press F5 or choose Debug > Start Debugging. For an overview of the debugger and its launch workflow, see Microsoft’s debugger feature tour.
If Visual Studio stops or prompts during the build
Use the first useful error in Output or Error List to identify what prevents launch. Visual Studio’s build-and-run behavior can depend on settings for whether it builds all projects or only the startup project and its dependencies. The Build and Run options also matter in C++: depending on project configuration, Visual Studio can prompt, launch a previously successful build, or refrain from launching after build or deployment errors.
Launching an old successful build can put the running program out of sync with the source you are viewing. Confirm that the latest build succeeded before relying on a breakpoint or result. If the Output window does not show enough detail, increase MSBuild output verbosity in the Visual Studio build settings and rebuild to expose more diagnostic information.
Recommended Free Tools
If the wrong project launches or no target can run
Return to Solution Explorer and set the intended executable or application project as the startup project. In a solution with multiple projects, the project selected for startup determines what F5 attempts to launch; it may not be the project currently open in the editor.
#1 Best Overall
If the selected project is a DLL or class library, it may not be independently runnable. Choose its host or calling application as the startup project, or use the launch action supported by that project type. Inspect the project’s Properties for its debug or start action, but do not apply legacy C# settings indiscriminately to .NET Core, ASP.NET, or other project types. Microsoft’s C# debug-configuration settings are specific to the project model they document.
If an ASP.NET or IIS launch fails
Check that the intended launch profile is selected and review the project’s debug properties, including the launch URL, App URL or App SSL URL, and environment variables. Make sure the project uses the Debug configuration when you are diagnosing debugger behavior. ASP.NET launch settings differ by project and hosting setup; Microsoft’s ASP.NET debugging guidance describes the relevant project properties.
Rank #2
A useful separation test is to start the application using its normal hosting route, then try Debug > Attach to Process. If attaching works and a breakpoint is hit while F5 still fails, the debugger can reach the running application and the project’s launch properties are a likely place to investigate. If your setup uses a HOSTS entry, check that it matches the host name being launched.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsIf you see “Unable to start debugging on the Web server”
Read the detail appended to the message before changing IIS settings. The message is generic: documented possibilities include a mismatch between the launch URL and server configuration, or changes involving the application pool or IIS. Apply a remediation only when the detailed error matches that cause; an IIS reset is not a universal fix. See Microsoft’s web-server debugging error guide.
Rank #3
If the application runs but the debugger does not stop at breakpoints
That points to a possible attachment or source-symbol mismatch rather than a failed launch. Choose Debug > Attach to Process (Ctrl+Alt+P), select the process running your application, and select the appropriate code type. A breakpoint can bind to source only when the source and symbols correspond to the build that is actually running; a Debug build is the usual starting point for source-level debugging. Microsoft explains the process and code-type selection in its guide to attaching to running processes.
Quick Recap
Best Value
Rank #4
Use the symptom to choose the next check
| What happens | Check next |
|---|---|
| Build errors appear before launch | Resolve the first relevant error in Output or Error List; verify dependencies and target-framework compatibility. |
| A different project launches, or nothing runnable is selected | Set the intended executable or host project as the startup project; check whether the selected project can run by itself. |
| The app is hosted by ASP.NET or IIS and F5 fails | Verify the profile, URL, App URL or App SSL URL, environment variables, and project-specific debug settings. |
| The app runs normally, but F5 or a breakpoint does not work | Try Attach to Process; check the selected process and code type, then verify that source and symbols match the running build. |
| The web-server error includes additional detail | Use that detail to identify a URL/server mismatch or a relevant IIS or application-pool change before applying a fix. |
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

