Contact us
Two people working at a desk with two monitors
Not sure where AI fits?

An AI opportunity audit looks at how the work gets done and gives you findings and a plan.

Start with an audit
Two people mapping a process on a whiteboard

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.

Written by the team at AI Integration Partners. About us

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.

Questions

How to use GitHub Copilot in Visual Studio: your questions answered

Have a question this guide does not answer?

Talk to us
Is 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.

A woman on a video call at her desk

Tell us what is taking too long.

It starts with a phone call, then an audit.

Talk to us
Talk to us