Thank you for reaching out.
The dialog “A fatal error has occurred and debugging needs to be terminated. HRESULT=0x8013132d, ErrorCode=0x0” appears before your Hello World runs.
That means Visual Studio’s managed debugger couldn’t initialize or attach to the .NET runtime. This typically points to one of these environment issues (not your code):
- A mismatch or incomplete install of .NET 10 SDK/targeting pack vs the debugger components in VS 2026.
- Corrupted VS user caches/MEF composition or a third‑party extension breaking the debugger early.
- Rarely: security software interfering with the attach, or custom launchSettings.json/project settings causing an early failure. Steps to fix
- Try Safe Mode (quick isolation) Close VS → open Developer Command Prompt → run:
devenv /safemodeCreate a new Console App (.NET 10) and press F5.- If it works in Safe Mode → an extension or cached state was the culprit. Disable non‑Microsoft extensions and go to Step 2.
- Clear Visual Studio caches (safe to do) Close VS, then delete these folders (they’ll be rebuilt):
-
%LOCALAPPDATA%\Microsoft\VisualStudio\18.0\ComponentModelCache -
%LOCALAPPDATA%\Microsoft\VisualStudio\DebuggerStart VS normally, try F5 again.
-
- Verify .NET 10 SDK/Runtime are really present In a terminal:
dotnet --list-sdksdotnet --list-runtimesEnsure you see .NET 10 SDK and runtime entries.- If .NET 10 is missing or only previews show up → install/repair .NET 10 SDK and the .NET 10 targeting pack; then retry.
- Retarget and keep the project simple In your
.csproj, confirm:<TargetFramework>net10.0</TargetFramework>Temporarily removelaunchSettings.json(if present), and use just: C#:Console.WriteLine("Hello World");Console.ReadLine(); // keeps process alive during attach - Reset Visual Studio user data devenv /resetuserdata Reopen VS, create a fresh .NET 10 console app, press F5.
- Repair workloads/components in VS Installer Open Visual Studio Installer → Modify:
- Make sure “.NET desktop development” is installed.
- Under Individual components, ensure .NET 10 runtime + .NET 10 targeting pack + .NET debugging tools are checked. Choose Repair, then retry.
- Debugger options sanity check In Tools → Options → Debugging:
- Uncheck “Enable Just My Code” for this test.
- Ensure Symbol settings are default. In Project → Properties → Debug, set Debugger type = Managed (or Auto) and test F5.
- Security software check (if corporate AV/EDR present) Temporarily disable aggressive script/behavior monitoring, or add exclusions for:
-
devenv.exe,vsdebugeng.exe,VsDebugConsole.exeThen try F5 again.
-
- Collect the first failing clue (for escalation) Run: devenv /log Reproduce the crash, then open:
%APPDATA%\Microsoft\VisualStudio\18.0\ActivityLog.xmlThe first error entry points to the exact component/extension to fix. References
- Visual Studio 2026 Release Notes (Debugging & diagnostics) – current features and fixes; repairing workloads/components is covered here https://learn.microsoft.com/en-us/visualstudio/releases/2026/release-notes
- Debugging techniques and tools (Visual Studio) – recommended practices, options, and how to collect useful diagnostics https://learn.microsoft.com/en-us/visualstudio/debugger/write-better-code-with-visual-studio?view=visualstudio
- Try Safe Mode (quick isolation) Close VS → open Developer Command Prompt → run:
Please let us know if you require any further assistance, we’re happy to help. If you found this information useful, kindly mark this as "Accept Answer". So that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.