Users Pricing

articles

Home Articles GitHub Copilot in Visual Studio, A Productivity Guide for .NET Developers – MindStick
GitHub Copilot in Visual Studio, A Productivity Guide for .NET Developers

GitHub Copilot in Visual Studio, A Productivity Guide for .NET Developers

Ivan Nikolaev 13 29 Nov 2026

For .NET developers, Visual Studio remains the home of serious work: large solutions, the debugger, profilers, designers and decades of muscle memory. GitHub Copilot has grown from an autocomplete add-on into a set of agents built deeply into that environment, especially since Visual Studio 2026 became generally available in November 2025.

Many developers still use only a fraction of what Copilot offers, mainly inline suggestions. This guide walks through the features that make the biggest difference for C# and .NET work, and the habits that keep AI-assisted code safe.

What Copilot offers in Visual Studio today

GitHub Copilot in Visual Studio now spans several layers:

- Code completions: inline suggestions as you type, including multi-line and next-edit suggestions.
- Copilot Chat: ask questions about code, errors and concepts, with context from your solution.
- Agent mode: Copilot plans and makes multi-file changes, runs builds and tests and iterates.
- Specialised agents: built-in agents for planning, debugging, Git, modernisation, profiling and testing, selectable from the agent picker.
- Custom agents and skills: your own specialised agents and reusable skills defined in your repository.
- MCP servers: connections to external tools and data through the Model Context Protocol.
- Cloud agent: delegate tasks to GitHub's coding agent, which works in the cloud and opens a pull request.

Feature availability depends on your Copilot plan and Visual Studio version, and Microsoft ships updates monthly, so check the release notes for your channel.

Getting set up

1. Install or update to Visual Studio 2026 and keep it on the latest stable update.
2. Sign in with a GitHub account that has a Copilot plan. Copilot Free offers limited usage; paid individual plans and Business or Enterprise plans for organisations offer more.
3. Open Copilot Chat from the Copilot badge or the View menu.
4. In organisations, check with administrators which features, models and MCP servers are allowed by policy.

Completions, the everyday win

Inline completions are most useful when Copilot understands your intent. Help it by:

- writing a clear method name and signature first
- adding a short XML documentation comment describing behaviour
- keeping related code open in nearby tabs
- following consistent naming patterns in your solution

Accept partial suggestions when only part is right. Recent updates let you accept just a portion of a completion with a click, which reduces the temptation to accept everything and fix it later.

Chat for understanding code

Copilot Chat shines when you need to understand rather than write:

- Explain how this controller handles authorisation.
- Why does this LINQ query cause a client-side evaluation warning?
- What would break if I made this property nullable?

Reference specific files, methods or the whole solution in your question to give Chat the right context. For error messages, paste the exact exception and stack trace.

Agent mode for multi-file changes

Agent mode turns Copilot into a collaborator that can carry out a task across the solution: it reads relevant files, proposes and applies edits, builds, runs tests and fixes errors it finds.

Good tasks for agent mode:

- add a new API endpoint with validation, service logic and tests
- rename a concept across layers consistently
- convert synchronous data access to async throughout a module
- add logging and error handling to a set of services

Tips:

- Describe the goal, scope, constraints and how to verify success.
- Use the planning agent first for larger tasks, review the plan, then hand it off to agent mode for implementation.
- Keep tasks focused. Several small, reviewed changes beat one sprawling change.
- Watch the changes as they happen and stop the agent if it heads in the wrong direction.

Specialised agents for .NET workflows

Visual Studio includes agents tuned for particular jobs.

Debugger agent

Helps investigate failures with access to runtime information, such as variable values and call stacks, and can validate a proposed fix against actual runtime behaviour rather than guessing from code alone.

Test agent

Generates unit tests for existing code. Review generated tests carefully: good tests check behaviour and edge cases, not just that the implementation does what it already does.

Profiler agent

Helps interpret performance data and suggests where to optimise, which is useful when profiler output is overwhelming.

Modernisation agent

Assists with upgrading projects, such as moving from .NET Framework to modern .NET or updating dependencies, by assessing the project, proposing a plan and carrying out steps. Run it in a guided way on important projects so you approve each stage.

Git agent

Helps with Git tasks such as summarising changes and exploring pull requests from within chat.

Teach Copilot your conventions

Generic suggestions are the main complaint about AI assistants. The fix is to give Copilot project-specific guidance.

Custom instructions

Add a repository instructions file in the GitHub folder of your repository describing your conventions: target framework, architecture, naming rules, preferred libraries, error handling approach and testing framework. Copilot includes these instructions automatically. Organisations on Business and Enterprise plans can also define organisation-level instructions.

Example content to include:

- We target .NET 8 with nullable reference types enabled.
- Use the repository and service pattern; controllers stay thin.
- Use FluentValidation for request validation.
- Write xUnit tests with the Arrange, Act, Assert structure.
- Never use string concatenation for SQL; use Entity Framework Core or parameterised Dapper queries.

Custom agents

You can define specialised agents as agent definition files in your repository, giving each a name, description, instructions and allowed tools. Examples include a security reviewer, a database migration helper or an API documentation writer. User-level agents travel with you across projects, and organisations can share agents across teams.

Skills

Agent skills are folders of instructions and supporting files that Copilot discovers in your repository or user profile and loads when relevant. They suit repeatable procedures such as your release checklist or a code review routine.

Connecting tools with MCP

Copilot in Visual Studio supports MCP servers, so agents can use tools such as databases, issue trackers, documentation sources and package information. For example, Visual Studio can use a NuGet MCP server to help fix vulnerable packages flagged by NuGet audit warnings.

Treat MCP servers like any third-party code: install only trusted servers, review permissions and follow your organisation's policies.

Choosing models

Copilot offers a choice of AI models from several providers, including OpenAI, Anthropic and others, depending on your plan and organisation settings. Different models suit different tasks; a faster model can be ideal for quick questions, while a more capable model may handle complex refactoring better. Premium models may consume premium request allowances, so check your plan's limits.

Delegating to the cloud agent

For well-defined tasks, such as fixing a reported bug or adding a small feature, you can delegate work to the cloud agent from Visual Studio. It works on a branch in GitHub's cloud environment and opens a pull request for you to review. This frees you to continue other work while it runs.

It works best with clear issues, good tests and a repository that builds reliably in a clean environment.

Safe habits for AI-assisted .NET code

- Review every change as you would a colleague's pull request.
- Run tests and the build before committing, and add tests for new behaviour.
- Check security-sensitive code such as authentication, authorisation, input validation, cryptography and data access with extra care.
- Verify APIs against official documentation, especially for recently updated libraries.
- Watch scope creep. Reject unrelated changes the agent made along the way.
- Protect secrets. Keep connection strings and keys out of source files and out of prompts.
- Respect licences and policy, and enable your organisation's code referencing or duplication filters if required.

A sample workflow for a new feature

1. Write or pick a clear issue with acceptance criteria.
2. Ask the planning agent for an implementation plan referencing the relevant projects.
3. Review and adjust the plan.
4. Let agent mode implement it, including tests.
5. Use the debugger agent if tests fail in non-obvious ways.
6. Review the diff carefully, run the full test suite and commit.
7. Ask Copilot to summarise the change for the pull request description.

Measuring the impact

Track simple indicators over a few months: time from issue to pull request, review rework, defect rates and developer satisfaction. Copilot's usage dashboards for organisations help show adoption. Use the data to decide where to invest in custom instructions, agents and training.

Key takeaways

- Copilot in Visual Studio 2026 goes far beyond completions, with chat, agent mode and specialised agents.
- Use planning and agent mode for multi-file work, and debugger, test, profiler and modernisation agents for focused tasks.
- Custom instructions, agents and skills make output match your conventions.
- MCP servers connect Copilot to your tools; treat them with care.
- Delegate well-defined tasks to the cloud agent.
- Review, test and secure every AI-generated change.

Used thoughtfully, Copilot becomes a powerful extension of a .NET team's skills rather than a source of generic code to clean up.

Related articles on MindStick

- Troubleshooting GitHub Copilot Suggestions and Setup Issues
- Claude Code for Real Projects, A Developer Workflow Guide
- Prompt Patterns That Improve ChatGPT Code Quality
- Model Context Protocol Explained, Connecting Claude to Your Data

GitHub Copilot and Visual Studio receive frequent updates, and features vary by plan and policy. Check the official release notes and documentation for your version.


Ivan Nikolaev

Senior Backend Developer at VK

Senior Backend Developer at VK, Saint Petersburg. I graduated from Novosibirsk State University with a bachelor's degree in Applied Mathematics and Informatics and completed a master's degree in Software Engineering at Saint Petersburg State University. I have 4 years of experience in backend development in Go and Python for high load services.


Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md