
Guide
How to use GitHub Copilot in Visual Studio
GitHub Copilot is built into recent versions of Visual Studio, helping .NET and C++ developers write, understand and fix code. Here is how to set it up and use its main features.
Setting up
Recent versions of Visual Studio include GitHub Copilot. Sign in with a GitHub account that has a Copilot plan, from the Copilot badge or account settings, and check that Copilot is enabled.
Code completions
Copilot suggests code inline as you type, from single lines to whole methods. Press Tab to accept. Descriptive method names and comments lead to better suggestions.
Copilot Chat
Open the Copilot Chat window to ask questions about your solution, such as explain this class, how do I add logging here, or write unit tests for this method. Reference files and symbols to focus the answer.
Inline chat
Ask for changes directly in the editor, such as refactor this method or add null checks, and review the proposed change before accepting.
Edits across files and agent mode
Copilot can propose changes across several files from one request. In agent mode it plans a task, edits files, builds and runs tests, and iterates, with you approving.
Debugging help
When an exception occurs, ask Copilot to explain it and suggest fixes. It can also help analyse failing tests and suggest breakpoints.
Commit messages and reviews
Copilot can draft commit messages from your changes and summarise pull requests.
Good practice
Review every suggestion, run tests, keep secrets out of code, and follow your organisation's Copilot policies, such as blocking suggestions matching public code.
Where to start
Ask Copilot Chat to explain a part of your solution you know least, then have it write tests for one class and review them.
Where we do this for you
Where we can help with this
The services and builds closest to this guide.
Tool page
GitHub Copilot for business
Policies, repository rules, and developers trained on real work.
Read moreTraining
Copilot training
Hands-on Copilot training for teams that work in Microsoft 365.
Read moreTool page
Copilot for business
Copilot in Outlook, Word, Excel and Teams, with your files in order.
Read moreService
Claude Code training
We set your team up with Claude Code and teach them the basics, so they can start building their own internal systems.
Read moreQuestions
How to use GitHub Copilot in Visual Studio: your questions answered
Have a question this guide does not answer?
Talk to usIs GitHub Copilot available in Visual Studio?
Yes, built into recent versions.
Can Copilot write unit tests in Visual Studio?
Yes. Ask in Copilot Chat, then review the tests.
Does Copilot help with debugging in Visual Studio?
Yes, by explaining exceptions and suggesting fixes.
Can Copilot write commit messages?
Yes, from your staged changes.
Is Copilot in Visual Studio the same as in VS Code?
The core features are similar; each is integrated with its own editor.
Do I need a paid plan?
A Copilot plan is needed; check current options.
Keep reading
More guides and pages

Tell us what is taking too long.
It starts with a phone call, then an audit.

