GitHub Copilot in Visual Studio: Setup, Context and Review

GitHub Copilot works inside Visual Studio for C#, C++, and other .NET and native development languages. Here is how to install it, give it useful project context, and review its suggestions before committing.

Updated 4 min read

GitHub Copilot is available inside Visual Studio 2022 and Visual Studio 2019 through an extension. For .NET developers working in C# or Visual Basic, and for C++ developers, it brings inline completions and an AI chat panel without leaving the IDE they already use. The setup is a few minutes; the value comes from configuring it for your solution, reviewing its suggestions carefully, and keeping your project decisions and progress outside the tool so they are available when you need a different assistant. fenbs stores that shared record.

Installing Copilot in Visual Studio

In Visual Studio 2022 (version 17.6 or later), go to Extensions, then Manage Extensions, search for GitHub Copilot, and install it. Restart Visual Studio when prompted. Sign in with your GitHub account through Tools, Options, GitHub. Copilot starts offering inline completions immediately. The exact steps and minimum version requirements may change as GitHub updates the extension; check the Visual Studio Marketplace listing (opens in a new tab) for the current requirements.

If you have Visual Studio 2019, the same extension is available, but some features may differ from the 2022 version. If Copilot is not working after installation, check that your GitHub account is signed in and that your account has an active Copilot subscription. For troubleshooting, GitHub Copilot not working in Visual Studio covers the common issues.

Giving Copilot context for your solution

Copilot reads from open files and from any context instructions you provide. In Visual Studio, you can add a .github/copilot-instructions.md file to the repository root to set standing rules: the target framework, naming conventions, which namespaces to use, and what not to change. Keep this file short. Long instruction files dilute the signal.

For a solution with multiple projects, be specific about which project's conventions apply to which area. A global instruction file with the framework and test runner, plus per-project notes in comments or a supplementary file, is a practical setup for larger solutions.

Put the context file in version control so every developer who opens the solution gets the same instructions. Review it when a new library is added or a naming convention changes. An outdated instruction file is worse than none, because Copilot will follow the wrong conventions confidently.

Using inline completions in Visual Studio

Copilot shows inline completions as gray ghost text as you type. Tab accepts the suggestion. Escape dismisses it. Alt+. or Alt+, cycles through alternative suggestions for the same completion. In C# code, Copilot often suggests the full method body when you type a method signature and a comment describing what the method should do.

Do not accept a suggestion without reading it. The completion may import a namespace you are not using, use a deprecated API, or implement a slightly different behavior from what you intended. Reading the suggestion before accepting it is the habit that separates productive Copilot use from a source of hidden bugs.

Using the Copilot chat panel

The chat panel in Visual Studio lets you ask questions about your code without leaving the IDE. Highlight a block of code, right-click, and choose Copilot options such as Explain, Fix, or Generate Tests. You can also open the chat panel directly and ask anything about the codebase in the current editor context.

Use the chat panel to explain a class you are about to modify, to understand a LINQ query, or to ask what a particular API method does. The explanation is often faster to read than finding the documentation. That said, verify anything security-related against official Microsoft documentation rather than relying on Copilot's response.

How fenbs helps

Keep project decisions and progress outside the tool

Connect a supported AI tool to fenbs over MCP from Integrations. Record your project's conventions, approved libraries, and review requirements as Decisions and rules. At the start of each session the assistant reads those rules and the current task status. When you stop or switch tools, save progress so the next session continues from Where we left off.

Create a free account

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

Reviewing Copilot suggestions before committing

In Visual Studio, use the Git Changes window to review the full diff before staging. Check every file the assistant touched, not just the ones you asked it to work on. Run all tests before committing — not just the test file for the feature you changed. For larger changes made with agent mode, compare the diff against the task description to confirm the scope matches.

If you find unexpected changes to files you did not ask Copilot to touch, dismiss them and add those paths to your context file as exclusions. Then repeat the task with a clearer scope description. Recording what the boundary should have been means the next session starts with that constraint already in place.

How to do this with fenbs

  1. Create a free account and add a project for the Visual Studio solution you are working on.
  2. Add the current tasks and their status. Write down the decisions that govern the solution: the target framework, the approved libraries, the naming convention, the test requirement.
  3. Record those decisions as Decisions and rules, not just as notes, so a connected assistant sees them first at the start of every session.
  4. Connect a supported AI tool from Integrations. Ask it to read the project context before starting work and to save task progress before stopping.
  5. When you resume after a break or hand the work to another session, the assistant reads Where we left off and continues from the same point.

Questions people ask.

Which versions of Visual Studio support GitHub Copilot?

GitHub Copilot is available as an extension for Visual Studio 2019 and 2022. The full feature set, including the chat panel and agent capabilities, requires a more recent version of 2022. Check the extension page on the Visual Studio Marketplace for the current minimum version.

How do I give GitHub Copilot instructions about my Visual Studio project?

Add a .github/copilot-instructions.md file to your repository root. Write the project conventions: the framework, the naming rules, the namespaces to use, and any restrictions. Keep it short. Copilot reads this file as part of its context for every response.

What languages does GitHub Copilot support in Visual Studio?

GitHub Copilot supports C#, C++, Visual Basic, F#, Python, JavaScript, TypeScript, and other languages that Visual Studio handles. Quality of suggestions varies by language. C# is typically the strongest given the volume of C# code in Copilot's training data.

How do I review code that Copilot generated in Visual Studio?

Use the Git Changes window to view the full diff before staging. Read every file the assistant changed, run the tests, and confirm the changes match your intended task. Do not commit until you have read the diff and the tests pass.

More in Agent harness (for developers)

All Agent harness (for developers) articles

Start with one thing.

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

There is nothing to set up first. Write one line and you’ve started.