Testing + Debugging + Profiling with GitHub Copilot in Visual Studio 2026
Copilot testing + @debugger + profile-with-copilot-agent — the three Visual Studio 2026 features that make real debugging work.
About This Course
Learn the three Copilot features that genuinely only ship in Visual Studio 2026: deterministic Copilot testing for .NET, the @debugger specialized agent, and profile-with-copilot-agent. You will author xUnit test suites against an untested API, triage the generated suite like a reviewer, use @debugger with conditional breakpoints to isolate a Blazor Server page that drops data, profile a slow data-warehouse query, and ship the fix behind a Git-agent review. By the end you will have a reusable testing layout and a debug + profile playbook that transfers to real production work.
Course Curriculum
6 Lessons
Copilot testing for .NET — how it differs from a prompt
Learn the Visual Studio 2026 Copilot testing feature that generates xUnit, NUnit, or MSTest suites directly from a selected class: the guided test-generation workflow, deterministic generation anchored on the production class, framework auto-detection, test naming conventions, and the Edit-review loop that lets you accept, reject, or regenerate individual tests. By the end of this lesson you will be able to explain why Copilot testing produces materially different output than an Ask-mode "write tests for this class" prompt + judge when to use it over the specialized agent or a plain prompt.
Generate the Products API test suite with Copilot testing - Lab Exercises
Note: This lab pre-provisions a Windows VM and the Halcyon.Adventure.Testing starter files at start — allow up to 10 minutes for the environment to become ready before beginning the exercises.
Start from an untested ASP.NET Core Products API, run the Copilot testing feature to generate a baseline xUnit suite, triage each generated test like a reviewer (accept the obvious, reject the trivial, add the missed cases), and establish the project's test-layout convention. By the end you will be able to apply Copilot testing to any Halcyon.Adventure.* project and know which tests Copilot reliably generates vs which the author must add by hand.
@debugger and debug-with-Copilot in Visual Studio 2026
Learn the @debugger specialized agent in Visual Studio 2026 Copilot Chat: how it reads the active debug session, inspects locals + call stack through chat, answers "what is this exception" with live context, suggests conditional breakpoints anchored on specific predicates, and composes with Edit mode to land the fix. By the end of this lesson you will be able to explain the three debugging modes @debugger changes (exception triage, breakpoint design, locals inspection) and judge when to reach for @debugger over the plain debugger UI.
Debug a Blazor Server page that drops data with @debugger - Lab Exercises
Note: This lab pre-provisions a Windows VM and the Halcyon.Adventure.Testing starter files at start — allow up to 10 minutes for the environment to become ready before beginning the exercises.
Start from a repro of a known Halcyon production bug — a Blazor Server page that silently drops data when two reps edit the same customer simultaneously. The bug is pre-staged in the starter (a missing event unsubscribe + a swallowed exception in a lifecycle method). You will use @debugger with a conditional breakpoint to find both faults, write a regression test that unlocks and reliably reproduces the drop, then land the fix in Edit mode. By the end you will have the full @debugger + conditional-breakpoint + Edit-mode-fix loop in muscle memory.
profile-with-copilot-agent + the Git-agent code review
Learn the Visual Studio 2026 profile-with-copilot-agent workflow: how Copilot reads a .diagsession CPU or allocation sample, summarizes the hotspots in natural language, proposes targeted fixes anchored on specific stack frames, and composes with the Git-agent code review on the resulting PR. By the end of this lesson you will be able to interpret a Copilot profiler summary against the Course 6 Lesson 3 performance patterns, judge which proposed fixes to apply vs defer, and request a Git-agent review that catches what Review Selection missed.
Profile + fix a slow DW analytics query with the Copilot profiler - Lab Exercises
Note: This lab pre-provisions a Windows VM and the Halcyon.Adventure.Testing starter files at start — allow up to 10 minutes for the environment to become ready before beginning the exercises.
Start from a Halcyon Analytics Dashboard chart whose query takes 6 seconds against the restored AdventureWorksDW database — the slow query is pre-staged in the starter (a YEAR() predicate on the fact column + a SELECT of the full entity + missing AsNoTracking). You will baseline the latency, run profile-with-copilot-agent to capture + summarize the CPU sample, use @debugger to isolate the hot stack frame, apply the fix (which aligns with Course 6 Lesson 3's four performance patterns), measure the improvement, and ship behind a Git-agent code review. By the end you will have the full profile-isolate-fix-review loop as a transferable production practice.