{"id":4149,"date":"2026-05-26T17:13:06","date_gmt":"2026-05-26T17:13:06","guid":{"rendered":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2026\/05\/26\/doing-more-with-github-copilot-as-a-net-developer\/"},"modified":"2026-05-26T17:13:06","modified_gmt":"2026-05-26T17:13:06","slug":"doing-more-with-github-copilot-as-a-net-developer","status":"publish","type":"post","link":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2026\/05\/26\/doing-more-with-github-copilot-as-a-net-developer\/","title":{"rendered":"Doing More with GitHub Copilot as a .NET Developer"},"content":{"rendered":"<p>For most .NET developers, the best way to get started with GitHub Copilot is not by learning every feature first. It is by using the right Copilot experience for the work already in front of you.<\/p>\n<p>Inline completions are part of that story, of course. They help with the everyday C# work that is repetitive but still necessary: filling in tests, building out LINQ expressions, wiring up DTOs, or scaffolding a Minimal API endpoint. But the bigger gains usually show up when you start using <strong>chat<\/strong> for reasoning and <strong>agentic workflows<\/strong> for scoped execution.<\/p>\n<p>That is where the different surfaces matter. Visual Studio, Visual Studio Code, the Copilot CLI, and the cloud coding agent each shine on different kinds of .NET tasks. The question is not which one is \u201cmost advanced.\u201d The better question is: <strong>which one fits the job I am doing right now?<\/strong><\/p>\n<h2>Start with the task, not the mode<\/h2>\n<p>The fastest way to get value is to stop asking, \u201cWhich Copilot feature should I try?\u201d and start asking, \u201cWhat part of this task should I delegate?\u201d<\/p>\n<h3>Real examples of using chat in .NET work<\/h3>\n<p>Chat becomes useful the moment you need explanation, comparison, planning, or targeted code generation based on your actual project.<\/p>\n<h4>Example 1: Understand a service before changing it in Visual Studio<\/h4>\n<p>Suppose you open a legacy ASP.NET Core service and find a class with five dependencies, several feature flags, and business rules buried in a long method. Before you change it, use chat to get oriented.<\/p>\n<p>Prompt:<\/p>\n<pre><code class=\"language-txt\">Explain what this service is responsible for, identify the key dependencies, and point out which parts are business logic versus infrastructure concerns. Then suggest a safe first refactor that does not change behavior.<\/code><\/pre>\n<p>That is far better than asking for a blind rewrite. It helps you understand the codebase you already have, which is often the real bottleneck in .NET work.<\/p>\n<h4>Example 2: Generate tests for business logic in Visual Studio<\/h4>\n<p>Imagine you have a pricing method that applies discounts, caps, and regional tax rules. You can write the first happy-path test yourself, then use chat to help fill out the edge cases.<\/p>\n<p>Prompt:<\/p>\n<pre><code class=\"language-txt\">Create unit tests for this method using the same test style as this project. Cover discount boundaries, null input handling, and the case where the total is capped. Explain any edge cases you think are easy to miss.<\/code><\/pre>\n<p>Bonus: If you are in Visual Studio, use the Test Agent. If you are in VS Code or the CLI, use the <a href=\"https:\/\/github.com\/dotnet\/skills\/tree\/main\/plugins\/dotnet-test\">dotnet-test skill<\/a> for the best success. This is a strong use case because you want both output and reasoning. You do not just want test code. You want confidence that the right cases were considered.<\/p>\n<h4>Example 3: Plan a refactor before touching the code<\/h4>\n<p>Let us say a controller has too much logic in it and you want to move validation and orchestration into a service. Chat is useful before you edit anything.<\/p>\n<p>Prompt:<\/p>\n<pre><code class=\"language-txt\">Review this controller action and propose a refactor that moves orchestration into a service without changing the HTTP contract. Show the target shape of the controller, service interface, and unit tests I should expect to update.<\/code><\/pre>\n<p>Enter Plan Mode before doing this and Copilot will create a detailed plan for either you or Copilot to implement when it\u2019s ready. This works well in Visual Studio because you are already looking at the relevant files and solution structure.<\/p>\n<h4>Example 4: Use VS Code when the change crosses code and configuration<\/h4>\n<p>A common .NET scenario is not just changing C# code. It is changing the API, the OpenAPI description, a deployment file, and the documentation in one pass. That is where VS Code often feels especially comfortable.<\/p>\n<p>Prompt:<\/p>\n<pre><code class=\"language-txt\">I am adding a new optional region filter to this endpoint. Update the ASP.NET Core handler, adjust the OpenAPI description, and point out any config, docs, or client code that may also need to change.<\/code><\/pre>\n<p>This is where chat starts to feel less like autocomplete and more like a working partner. It can help you think across the whole repo, not just the file in front of you.<\/p>\n<h4>Example 5: Use the Copilot CLI to reason about a failing build<\/h4>\n<p>If dotnet test or dotnet build fails, the CLI is a natural place to work because the failure is already in your terminal.<\/p>\n<p>Prompt:<\/p>\n<pre><code class=\"language-txt\">Explain this build failure in plain English, tell me which project likely introduced it, and suggest the next two commands I should run to narrow it down.<\/code><\/pre>\n<p>Or:<\/p>\n<pre><code class=\"language-txt\">This xUnit test is failing intermittently. Based on the output and the file paths involved, what are the likely causes, and what should I inspect first?<\/code><\/pre>\n<p>That is a better starting point than dumping the error into a search engine because the CLI can stay close to your actual repo and command loop.<\/p>\n<h3>What good chat prompts look like<\/h3>\n<p>For .NET work, the best chat prompts usually include four things:<\/p>\n<ol>\n<li>the goal<\/li>\n<li>the code or command output<\/li>\n<li>the constraint<\/li>\n<li>the expected shape of the answer<\/li>\n<\/ol>\n<p>For example:<\/p>\n<pre><code class=\"language-txt\">Refactor this background worker to make the retry policy easier to test. Keep the public behavior the same, preserve structured logging, and show me the test cases I should add.<\/code><\/pre>\n<p>That is much stronger than:<\/p>\n<pre><code class=\"language-txt\">Improve this code.<\/code><\/pre>\n<p>The more the prompt sounds like a real code review comment or engineering task, the more useful the response tends to be.<\/p>\n<h3>Real-world agentic flows for .NET developers<\/h3>\n<p>Agentic workflows are most useful when the task is multi-step, bounded, and reviewable. You are no longer asking only for an answer. You are asking Copilot to carry out a piece of work.<\/p>\n<h4>Example 1: Fix a test gap across a feature slice<\/h4>\n<p>Suppose a new feature was added to an ASP.NET Core API, but only the happy path was tested. This is a strong agentic task in Visual Studio, VS Code, or the cloud coding agent.<\/p>\n<p>Task:<\/p>\n<pre><code class=\"language-txt\">Add missing unit tests for the CreateOrder flow. Cover validation failures, duplicate order detection, and the downstream payment timeout path. Keep the existing test style, do not rename public APIs, and stop once the new tests pass.<\/code><\/pre>\n<p>Why this works:<\/p>\n<ul>\n<li>the scope is clear<\/li>\n<li>the affected area is bounded<\/li>\n<li>there is an obvious definition of done<\/li>\n<li>the output is easy to review in a diff<\/li>\n<\/ul>\n<h4>Example 2: Clean up a repetitive refactor<\/h4>\n<p>Many .NET repos accumulate the same pattern in several places: inconsistent logging, nullable warnings, repeated guard clauses, or old result-handling code. That kind of work is tedious for a human and often well-suited to an agent.<\/p>\n<p>Task:<\/p>\n<pre><code class=\"language-txt\">Update the notification handlers in this project to use the shared Result&lt;T&gt; pattern instead of throwing validation exceptions. Preserve current behavior, update the affected unit tests, and summarize which handlers changed.<\/code><\/pre>\n<p>This is not glamorous work, but it is exactly the kind of task where agentic help can save real time.<\/p>\n<h4>Example 3: Use the Copilot CLI for a fix-and-verify loop<\/h4>\n<p>Agentic work does not only belong in the cloud. The CLI is useful when the task naturally involves commands, output, and iteration.<\/p>\n<p>Task:<\/p>\n<pre><code class=\"language-txt\">Investigate why dotnet test is failing in the Notifications.Tests project, make the smallest fix that addresses the root cause, rerun the relevant tests, and summarize the change.<\/code><\/pre>\n<p>This is a good CLI task because the whole workflow already lives in the terminal: inspect, run, fix, rerun, and explain.<\/p>\n<h4>Example 4: Use the cloud coding agent for a bounded multi-file change<\/h4>\n<p>The cloud coding agent is especially helpful when you have a real task that can run in the background and come back as a draft change for review.<\/p>\n<p>Task:<\/p>\n<pre><code class=\"language-txt\">Add correlation ID propagation to the API and background worker pipeline. Update middleware, logging enrichment, and the integration tests that assert the header flows through. Do not change unrelated logging format, and note any follow-up work if you find gaps outside this slice.<\/code><\/pre>\n<p>That is a strong cloud-agent candidate because it is broad enough to benefit from delegation, but still concrete enough to review carefully.<\/p>\n<h4>Example 5: Cross-stack work in VS Code<\/h4>\n<p>Some of the best agentic tasks are not purely C#. They touch the API, the deployment config, and the docs together.<\/p>\n<p>Task:<\/p>\n<pre><code class=\"language-txt\">Add support for a new beta environment flag. Update the .NET configuration binding, the Bicep template, the GitHub Actions workflow, and the deployment documentation. Keep naming consistent with the existing environment settings.<\/code><\/pre>\n<p>That is the sort of task where VS Code often feels like the right surface because the work is spread across code and adjacent assets.<\/p>\n<h2>How to decide between chat and agentic work<\/h2>\n<p>Here is the practical rule:<br \/>\nUse chat when you want help to <strong>understand, compare, outline, explain, or draft<\/strong>.<\/p>\n<p>Use <strong>agentic workflows<\/strong> when you want help to <strong>change, verify, update, rerun, and deliver a reviewable result<\/strong>.<\/p>\n<p>In practice:<\/p>\n<ul>\n<li>\u201cExplain this service and suggest a refactor\u201d is chat.<\/li>\n<li>\u201cImplement the refactor, update the tests, and keep the public contract unchanged\u201d is agentic.<\/li>\n<li>\u201cSummarize this failing build and tell me what to inspect\u201d is chat.<\/li>\n<li>\u201cFix the root cause, rerun the tests, and summarize the diff\u201d is agentic.<\/li>\n<\/ul>\n<p>If you can describe the task with a clear definition of done and you would be comfortable reviewing the resulting diff, it is probably a good candidate for agentic delegation.<\/p>\n<h3>A few habits that make Copilot more useful<\/h3>\n<p>Whether you are using chat or agents, a few habits go a long way:<\/p>\n<ul>\n<li>give the task a boundary<\/li>\n<li>name the constraints explicitly<\/li>\n<li>tell Copilot what must not change<\/li>\n<li>ask for the output in a useful shape<\/li>\n<li>review the result like you would review a teammate\u2019s PR<\/li>\n<\/ul>\n<p>For .NET developers, that often means including things like:<\/p>\n<ul>\n<li>keep the public API unchanged<\/li>\n<li>follow the existing xUnit pattern<\/li>\n<li>preserve DI registration style<\/li>\n<li>update nullable annotations only in this project<\/li>\n<li>rerun the relevant tests, not the whole universe<\/li>\n<\/ul>\n<p>Those details matter. They are what turn a generic AI interaction into a genuinely useful engineering workflow.<\/p>\n<h2>Final thought<\/h2>\n<p>The real value of Copilot for .NET developers is not that it can suggest a few lines of C#. It is that it can help you reason through real work and, when the task is well-scoped, carry some of that work forward.<\/p>\n<p>Use Visual Studio when you are deep in the solution. Use VS Code when the job crosses code, config, and docs. Use the Copilot CLI when the work lives in your terminal. Use the cloud coding agent when you have a bounded task worth delegating and reviewing. Really, use whatever tool works for you.<\/p>\n<p>Start with a real task from your own backlog: understand a service, add tests around tricky logic, fix a failing build, or hand off a repetitive refactor. That is where Copilot stops feeling theoretical and starts becoming useful.<\/p>\n<p>The post <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/doing-more-with-github-copilot\/\">Doing More with GitHub Copilot as a .NET Developer<\/a> appeared first on <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\">.NET Blog<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>For most .NET developers, the best way to get started with GitHub Copilot is not by learning every feature first. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":94,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[7],"tags":[],"class_list":["post-4149","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet"],"_links":{"self":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/4149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/comments?post=4149"}],"version-history":[{"count":0,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/4149\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/media\/94"}],"wp:attachment":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/media?parent=4149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/categories?post=4149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/tags?post=4149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}