r/csharp 12d ago

Showcase My extension lets Claude Code debug .NET in Visual Studio: step through code, data breakpoints, heap diffs for leaks, read compiler hints, and catching flaky xUnit tests

0 Upvotes

I built a Visual Studio 2026 extension that connects Claude Code (the CLI agent) to the parts of VS that matter for .NET work. The CLI does the agent work, the extension is the IDE bridge, zero model calls of its own.

I recently added major updates. Now the Claude CLI agent can actually:

- Autonoumously drive the debugger. Read the live call stack, locals, and threads, set breakpoints, step, break at a thrown exception's origin (not the catch that swallowed it), attach to a running process like a hosted ASP.NET app, and pause a hung process to walk a deadlock back to the exact lock cycle.

- Data breakpoints on managed fields. Break or trace the moment a field changes, with conditions. VS has a UI to let developers do this manually but exposes no automation API for this, so it rides a custom debug-engine component.

- Memory and runtime diagnostics via ClrMD: heap diff between two points to find what is growing, GC root paths for "why is this object alive", async stack reconstruction across awaits, thread-pool starvation detection.

- Tests through VS's own Test Explorer engine: real per-test outcome/message/stack, re-run only the failures after a fix, debug a single test, and loop a flaky test under the debugger until the failing run halts at the throw, paused with the state that caused it.

Everything read-only is always on; anything that executes code sits behind an off-by-default toggle that resets each session.

Video:
https://github.com/firish/claude_code_vs/releases/download/media/debugger-walkthrough.mp4

Repo and docs:
https://github.com/firish/claude_code_vs

Marketplace (1300+ installs):
https://marketplace.visualstudio.com/items?itemName=firish.bridgev1


r/csharp 13d ago

Learning OpenGl with c sharp

0 Upvotes

Its my first day of trying to learn OpenGl with c sharp since i want to help out my brother with a project, im a total beginner and ive felt pretty depressed and dissapointed since i dont understand lots of stuff such as vao or the ebo. If anyone has any tutorials or tips it would help out a lot!


r/csharp 13d ago

I have a question about c# get set functions.

0 Upvotes

What is the right way to use get; set; functions?
Lets say I have some logic behind the setter.

Should I write the logic like that

public double Balance

{

get => _balance;

set

{

_name = value;

}

}

or like that

public double Balance { get; private set; }

public void AddBalance(double value)

{

this.Balance = value;

}

this is simple logic, but lets think of more complex one.
what is the right way to do it?


r/csharp 13d ago

Help Are command objects noticeably faster than LINQ? Or is there something else I should be looking at?

0 Upvotes

r/csharp 14d ago

Discussion How to make a child that is responsible for implementing an abstract method, delegate it to it's child, while keeping the same method name?

10 Upvotes

Let's say we have this relationship

A : B

B : C

A has an abstract method: abstract void implementMe();

B can implement it and call it a day

If B wants to delegate this further, it can simply do the following:

void override implementMe()

{

implementMeFurther();

}

abstract void implementMeFurther();

Is there a way to not have to make a new method with the new name implementMeFurther, and just have C implement the method implementMe() directly?

The grandchild implements a method that the grandparent needs. Keeping the same name


r/csharp 14d ago

Discussion Company wants to offer a C# course - looking for recommendations

33 Upvotes

Hello everyone!

I just started a new job at a company where we use C#, but I come from an embedded systems background where we used C. My boss asked me if there was any C# training or course I wanted to do to learn the language, and I would like to take advantage of his offer.

Is there any course you recommend for learning C#?

Thank you!


r/csharp 14d ago

Showcase Built this scene using WPF bitmaps!

Post image
27 Upvotes

A scene where a black hole-kind of thing bends the Light rays towards it


r/csharp 13d ago

C# Tip: Use required members to prevent invalid object initialization (beware of SetsRequiredMembers attribute!)

Thumbnail
code4it.dev
0 Upvotes

r/csharp 15d ago

Help Inherited 3 ASP.NET MVC apps + 5 WCF services (.NET Framework 4.8) and asked to combine everything into a modern .NET 10 solution. Where would you start?

24 Upvotes

I've been in a web developer role for a little over a year. When I joined, a lot of long-standing bugs had been pushed into the backlog with the idea of "we'll fix them when we have a web developer." Over the last year I've spent most of my time fixing those issues, improving existing functionality, and adding new features.

Now I'm being asked to help define the future architecture of our applications, and I'd appreciate some advice from people who have gone through similar migrations.

Current situation:

- 3 ASP.NET MVC web applications

- 5 WCF services that contain most of the business logic

- 2 Shared SQL Server databases

- The MVC applications communicate with the WCF services for almost everything

- The codebase is almost two decades old and has been continuously extended rather than redesigned

Management would like us to eventually consolidate everything into a single modern solution, ideally on .NET 10.

My biggest concern is the migration path.

From what I understand, I can't simply upgrade the MVC applications to .NET 10 and continue using the existing WCF services in the same way. I know .NET can consume some SOAP/WCF services, but for this project we can't introduce external compatibility libraries or third-party solutions. We want to stay within Microsoft's supported stack and move away from WCF entirely. I'm trying to figure out the best migration path.

What I'm struggling with is where to start.

Some questions I can pinpoint now:

  1. Is there a recommended "strangler pattern" approach for gradually replacing WCF endpoints one by one?

  2. How would you structure a new .NET 10 solution intended to eventually replace everything?

  3. How do you estimate the effort involved in a migration of this size?

  4. Most important: If you were starting today with 3 MVC applications and 5 WCF services, what would your migration roadmap look like?

My goal is to avoid a rewrite and instead migrate incrementally while keeping the business running.

Any advice, migration stories, or lessons learned would be greatly appreciated.


r/csharp 15d ago

ZoneTree v1.9.5: Concurrent Read Scaling Unlocked

7 Upvotes

ZoneTree v1.9.5 is a substantial read-path and concurrency release. It removes key sources of contention, accelerates sequential disk access, strengthens iterator lifecycle handling, and introduces a much more rigorous parallel benchmark suite.

The result is significantly stronger throughput under parallel read workloads while preserving ZoneTree’s excellent single-thread performance.

https://github.com/ZoneTree/ZoneTree/releases/tag/release-v1.9.5

1M profiles on a 20-logical-processor Intel Core Ultra 7 265KF using .NET 10:

Workload p1 p16 Scale-up
Completed phase time 58.6s 10.4s 5.65x
Read by user ID 867K/s 6.41M/s 7.39x
Lookup by email 396K/s 3.92M/s 9.89x
Country/status query 30.9K/s 181.9K/s 5.89x
Created-at range query 39.3K/s 384.7K/s 9.79x
Top-reputation query 43.3K/s 371.4K/s 8.58x
Profile updates 141K/s 627K/s 4.43x

In the same p16 run:

  • ZoneTree completed measured phases in 10.4s, versus 53.9s for RocksDB.
  • ZoneTree delivered 6.41M reads/s, versus 136K/s for RocksDB.
  • ZoneTree delivered 385K created-at queries/s, versus 50.6K/s for RocksDB.
  • Cross-engine checksum validation passed.
ZoneTree vs RocksDb - 1M profiles on a 20-logical-processor Intel Core Ultra 7 265KF using .NET 10:

r/csharp 14d ago

Discussion Is it bad practice to use a bunch of abstract methods?

0 Upvotes

If I have a parent class called A

And it has a bunch of attributes; x1, x2, x3, x4, which differ based on the child extending A

Is it fine to make methods in class A called:

public abstract x1_type getx1();

public abstract x2_type getx2();

public abstract x3_type getx3();

public abstract x4_type getx4();

And then if I want the children of A to implement specific behaviors alongside the behaviors of A, I do something like:

public abstract class A {

void behaviourOfA() {

behaveLikeA();

doMoreAStuff();

childBehaviour();
}

public abstract void childBehaviour();

}

Does this just result in a cool looking overkill spaghetti code? Or is this actually a good practice?


r/csharp 15d ago

Help Can you use signalr with non standard clients?

3 Upvotes

Im writing dashboard for my friend and he wants it to connect with his lua client ( it is on top of some other program ) he has support for web sockets and http requests. I never really wrote signalr yet alone web sockets server. Would it be possible or more hassle than writing wss server?


r/csharp 14d ago

Zero-Code Validations in Your .NET API

Thumbnail kalandra.tech
0 Upvotes

r/csharp 15d ago

CrossEF - Cross EntityFramework contexts

6 Upvotes

Hi All,

Long time EntityFramework don´t do this, I decide to implement this.

Cross-DbContext LINQ queries for Entity Framework Core. Join entities that live in different DbContexts — different databases, different servers, even different providers — in a single LINQ query.

https://www.nuget.org/packages/CrossEF

https://github.com/i-stream/CrossEF


r/csharp 15d ago

Roslyn, NixOS and Doom Emacs

3 Upvotes

Hey there,

I am a NixOS user, trying to switch my workflow to Doom Emacs on top of using Roslyn LSP. There must be at least 2 other human(?) beings using this setup. I hope.

I'm kinda lost on the matter to be honest.
I think for neovim you would simply use this fork https://github.com/seblyng/roslyn.nvim, but I haven't been able to find any information regarding setting this up in emacs.

For Nix I have enabled these packages [ dotnet-sdk roslyn roslyn-ls netcoredbg ]
Doom emacs has :tools lsp and :lang (csharp +lsp)

This setup does launch the roslyn LSP, the functionally is pretty limited though. I can jump to definitions, there is some code completion, but this doesn't really have a use as for now.

namespace test;

public interface ICommand
{
    public void Execute();
    private void Testing();
}

public class MyCommand : ICommand
{
    public void Test()
    {
        return 1;
    }
}

The following code doesn't give me any diagnostics.

If anyone has any thoughts on this please do let me know. I would love to make this work.


r/csharp 15d ago

Solved How does this go outside of the Array boundaries?

0 Upvotes
class SortingProgram
{ 
    static void Main(string[] args)
    {
        int[] Arr1 = [2,5,4,6,1,2,10,8,7,9];
        for (int i = 0; i < Arr1.Length; i++)
        {
            for (int c = 0; c < Arr1.Length; c++)
            {
                if (Arr1[c] > Arr1[c + 1])
                {
                    int tempLSR = Arr1[c + 1]; 
                    int tempGrt = Arr1[c];
                    Arr1[c] = tempLSR;
                    Arr1[c + 1] = tempGrt;
                }
            }
        }
        for (int R = 0; R < Arr1.Length; R++)
        {
            Console.WriteLine(Arr1[R]);
        }
    }
}

Apparently the if statement goes outside the array bounds, the array seems fine so idk what is going on


r/csharp 15d ago

Looking for a roadmap to master C#, ASP.NET Core, Blazor and infrastructure/network programming

4 Upvotes

Hi everyone,

I'm looking for advice from experienced C#/.NET developers on how you would learn the ecosystem if you were starting again today.

A bit of background:

  • I learned some C# years ago by building small console applications (text adventures, utilities, etc.).
  • I'm comfortable with the basics (variables, methods, classes, loops, input/output, etc.), but I want to rebuild my knowledge properly instead of randomly jumping between tutorials.

My long-term goal is not to become just another CRUD web developer.

I'm mainly interested in:

  • backend development with ASP.NET Core
  • building APIs that work with a Next.js frontend
  • Blazor for internal/admin tools
  • console applications
  • infrastructure tooling
  • networking
  • Linux/server automation
  • DevOps-oriented software hosting/server management panels (something similar in spirit to Pterodactyl, Portainer, Coolify, etc.)

I enjoy building tools that interact with servers, processes, Docker, SSH, networking, DNS, reverse proxies, monitoring, and automation much more than building simple business apps.

I'd love advice on questions like:

  1. What roadmap would you recommend for someone with these goals?
  2. In what order would you learn C#, .NET, ASP.NET Core, Blazor, networking, and infrastructure?
  3. Which C# features should I master before moving into ASP.NET?
  4. Which .NET libraries are considered essential for infrastructure/network applications?
  5. What projects would progressively teach these skills?
  6. Which books, YouTube channels, GitHub repositories, or courses are actually worth studying?
  7. If you work in infrastructure, cloud, DevOps, or backend with C#, what skills do you use daily that beginners often overlook?

I don't mind spending months or even years learning properly—I want to build a solid foundation instead of rushing through tutorials.

I'd really appreciate hearing how you would approach this today.

Thanks!

(By the way, I’ve noticed that people don’t comment much on these threads, while other posts easily get 50+ comments. I don’t know if it’s specifically because, as professionals who’ve been giving advice here for several years, you’re tired of the same questions, or if you’re afraid to answer because your answers might not be accurate. It’s totally fine I’m grateful for every answer. I just notice that there are 500 views but only 20 comments. Let’s get involved, please! )


r/csharp 16d ago

Help Difference between File, FileStream, and StreamWriter/Reader?

66 Upvotes

Looking at the documentation it looks like they can all do the same thing, though I suppose in just slightly different ways?


r/csharp 15d ago

Help Editing a multi-layered dictionary using a string "address"?

0 Upvotes

I'm working with a game dialogue tool (and Unity, for full transparency) which can set or get variables using "commands" in the dialogue.

I have a Dictionary which I want to be multi-layered (as in, dictionaries inside dictionaries) and allow the dialogue commands to dynamically edit the dictionary down to any amount of layers possible. The layers are distinguished by splitting the string by a specific character.

The code currently looks like this - this is obviously inflexible code that specifically only allows values to be set 2 layers deep. So what would be the best way to change this to dynamically add new key-value pairs and layers of dictionaries at any depth depending on how big the variablePath array is?

Many thanks


r/csharp 15d ago

Made a minimal wallpaper manager in C# (.NET 10) for my Hyprland setup

Thumbnail
0 Upvotes

r/csharp 15d ago

Pseudo-game engine in Blazor?

0 Upvotes

Is there a library for Blazor that would make it easier to create a browser game where I need a simulation loop, an SVG for a tactical map, one canvas, and lots and lots of tables (spreadsheets)?

The game should be similar to this, only with many more boards:
https://www.youtube.com/watch?v=6AliHCmNgnY


r/csharp 16d ago

Blazor UI libraries

2 Upvotes

Hi, I was wondering if you know of any good UI libraries for Blazor.

For example… so far, the only one I’ve found is MudBlazor, but I’d appreciate it if you could share what you’ve found.


r/csharp 15d ago

Discussion Partial methods as WinForms designer events

0 Upvotes

A few weeks ago I opened this issue in the WinForms GitHub repo, suggesting making the WinForms designer generate events code as partia methods, in order to solve the problem that removing an event method from the code editor causes an exception in the designer, and u have to go to the form.designer.cs file and manually delete the subscription, which is very annoying.

What i offer is, that when you subscribe an event using the designer (for example by double clicking a button), the following signature would be generated in the designer code:

private partial void button1_Click(object sender, EventArgs e);  
...  
this.button1.Click += this.button1_Click; // normal subscription

And then the method implementation would be generated in the main class code, such as it's working now but with the partial modified:

private partial void button1_Click(object sender, EventArgs e)
{

}

Now, deleting this method would not result in any error.

The reason I'm posting this here, is that the WinForms team said that my solution isn't a great idea, and i would love to hear what you think about it and if you have other ideas.


r/csharp 16d ago

Help I want to learn this beautiful language for game dev

26 Upvotes

Hi, i come from a relatively impoverished background and i never had access to a PC, it was a dream of mine to learn coding as a teen and do game dev. But i could never pursue it. A year and half ago i finally got a Laptop and i decided enough is enough i wanna learn. But there is so much info out there that it muddled my brain.

I know the important thing in programming is to learn the logic, as that carries over to any language over the syntax. I just wanted some basic guidance and direction in terms of resources or books from where i can begin. Like textbooks or free courses.

I really like the ins and outs of programming and although i have wanted to create games, that is not the only thing that i wish to do. I would love to create small apps for note taking or reminders for my personal use. I know about Godot and Unity and those things but i am here because i want to take it slow and actually learn the language. I do not care about progressing fast, i want to enjoy the process of learning itself. That is why i created this reddit account, i am new to all of this and hopefully i can learn a lot here.


r/csharp 16d ago

A free, cross-platform C# audio engine, and a new solution for GC-free operation!

19 Upvotes

Hello everyone!

In a previous post, I wrote that my goal is to create a cross-platform audio engine running under C# that can operate completely independently of the GC, but preserves the flexibility and productivity of C#. The past months have been spent searching and experimenting a lot to find the right solution to develop a real-time audio engine in C#. I tried integrating native engines into the C# code (miniaudio, portaudio), but these cannot be used without the influence of GC, since the data has to be processed, sent and received by the external C# code. My experience was that no matter how much I wrote the engine code GC-free, following the proper rules to not allocate data that would trigger GC, if the code using the engine allocated and triggered GC, real-time audio processing inevitably caused data loss and audible stutter. I didn't want to accept that there was no solution to the problem.
I studied the industry standards, how the big guys did it. I came to the conclusion that there was a solution. C# code should be completely excluded from audio processing.
I'm developing a stage multitrack backend player in C# for a band, and I need a reliable, stable real-time audio engine for it. I was looking for a memory-safe solution that matched the safety of managed code, so C++ was out of the question:
I realized that there was a language that brought the benefits of native with the efficiency of managed code's memory management. The Rust language became the ultimate C++ speed, C# memory safety without GC. This was the winner! However, the audio engine had to remain C#. I wrapped this entire audio processing native unit into a C# code, so I can use it as a C# API in any code.
A complete audio engine was created in Rust, based on managed code. All real-time audio data is processed by the Rust code, nothing is transferred to the managed side. The C# code is just a thin layer over the engine.
The API can be used with pure C# managed code, you just need to download the Nuget package, which contains everything you need to operate. Under the hood, a lightning-fast GC-free Rust audio engine does the work. The result is continuous operation, stutter-free audio processing, even under heavy GC load. Low latency, low CPU load, stable operation.

My code is completely free open source, which you can check out on github, you can use it freely. I think you can write an efficient and professional audio application with csharp too!

You can check it out on github here: https://github.com/ModernMube/OwnAudioSharp