r/csharp • • 22h ago

Showcase I built Satori Insight, an open-source .NET heap and GC profiler with live region map

Thumbnail
gallery
26 Upvotes

I've been working on Satori Insight, a desktop app for exploring .NET memory usage and GC behavior. Built with Avalonia and NativeAOT.

The initial idea was a defrag-style map of the managed heap, where each block represents a region. It grew into a profiler that combines continuous telemetry with deeper heap inspection.

Some of the features:

  • Live heap metrics, allocation rate, CPU time, and RSS history.
  • Region maps by generation, occupancy, fragmentation, or queue.
  • Collection logs with memory stats, pause duration, and latency mode.
  • Pause histograms with p50, p90, p95, p99, p99.9, average, minimum, and maximum.
  • Timeline selection: click a time point or drag across a period to inspect its stats.
  • Heap captures for exploring types, objects, references, root paths, and snapshot comparisons.
  • Session recording and offline replay.

It supports standard Workstation and Server GC as well as Satori GC of course (see the name of the app).

It's now open-sourced at GitHub:

https://github.com/hez2010/SatoriInsight

You can try it out by downloading the binary for your platform from GitHub Releases.⁠


r/csharp • • 23h ago

C# is magic

63 Upvotes

When did you first realize that C# is magic? Or when did you realize that C# is right for you? 

Back in the days of the .NET Framework 4.0, I first encountered WCF, you call an interface on the client, and it executes the implementation on the server. At the time, my head was spinning because there was no code around it that was sending anything,it just happened on its own - magic. 


r/csharp • • 12h ago

100 Lines of Unit Tests to Prove That A or Not A Is True

14 Upvotes

Today, I stumbled upon a 100-line unit test. Due to my inability to understand the name AreMatchingGuestsNotRequiredUnlessTheyAreNotUnmatching, I stripped away all the noise to figure out what it was actually testing.

This is what it essentially boils down to:

[Fact]
public void AreMatchingGuestsNotRequiredUnlessTheyAreNotUnmatching()
{
    // Arrange
    var first = new Trn { Guests = 2 };
    var second = new Trn { Guests = 2 };

    // Act
    var areMatchingGuestsNotRequiredUnlessTheyAreNotUnmatching =
        first.Guests != second.Guests
        || first.Guests == second.Guests;

    // Assert
    Assert.True(areMatchingGuestsNotRequiredUnlessTheyAreNotUnmatching);
}

Here's what the test actually does:

  • Arrange two Trn.
  • Check whether their Guests are different OR equal.
  • Assert that the result is true.

I was quite surprised that the test name actually matches what the test does.

Or does it?


r/csharp • • 16h ago

Help How to clear a root-level cascading parameter in Blazor?

Thumbnail
0 Upvotes

r/csharp • • 4h ago

News CVE-2026-111497: a Brotli decoder bug forced an out-of-band .NET release (10.0.14) on Oct 25

Thumbnail
0 Upvotes

r/csharp • • 16h ago

Showcase fd-cs: fd (faster find) rewritten in C# and upto 2x faster

Thumbnail github.com
0 Upvotes

r/csharp • • 1h ago

Help What AI Workflow do you use?

• Upvotes

So I’ve kept been told AI is the next step and I need to keep up with it but I’ve never really know where to start. I know how to use ChatGPT and Claude on my web browser that’s it.

So I’m curious as to what Csharp developers really use for their AI workflow and are there any tutorials out there that are solid and I can learn.


r/csharp • • 10h ago

More cache. Less RAM. No cache server

Thumbnail
nuget.org
2 Upvotes

r/csharp • • 8h ago

Showcase Hexal - A modal text editor, 1:1 feature parity with Helix, with Lua plugins, written with C#

Thumbnail hexal.pages.dev
11 Upvotes

I did it initially because Helix seems to not want to add plugins to their editor, making it not very extensible, which is a shame. And Helix lacks a lot of features that would be useful.

Dependency-free (aside from NLua) architecture, no Terminal.Gui library dependency, written from scratch with C#.


r/csharp • • 12h ago

Tool SourceGen Utils: Utilities for source generators with zero dependencies

8 Upvotes

Hey all!

I've recently gotten my small utility library for source generators to a state where I feel comfortable sharing it.

The idea is simple: I want to reuse utilities for my source generators, like a library, without having to include extra dependencies. So I just generate the utilities directly into the source generator!

For regular NuGet this probably doesn't matter much, but it may matter more when developing with Unity, as I personally mostly do. In my Unity libraries I don't want to include a shared library that multiple packages may depend on and conflict with.

So what does it do?

  • CodeWriter - your typical StringBuilder wrapper with automatic indentation and several handy methods for easily emitting symbols, namespaces, and more
  • Pools - Collection pools and generic object pools for easy pooling (thread-safe too!)
  • VariableNames - Easily format names to something more readable (like when creating properties from fields)
  • ArrayBuilder - Build arrays with a ArrayPool backed struct instead of using heavy lists or ImmutableArray.Builder
  • SymbolExtensions - Easily get attributes from symbols
  • record and required support - Assembly attributes to easily inject polyfills to enable newer record and required keyword support

What about assembly size?

SourceGen utils includes a trimmer that runs automatically on build (can be disabled if you want) that removes all unused types, methods, properties and fields from SourceGen Utils. It just used Mono.Cecil to go through all the method instructions to see if something is used or not. So you only include what you use!

I've made sure to include tests for nearly all generated methods to make sure they all do what they are supposed to and that the trimmer won't remove anything that you actually use.

The project is open source, licensed under MIT, and available on NuGet. I've also created documentation so you can see what it has to offer!

Feel free to give feedback on the project and maybe even use in your own generators! :)

AI disclosure: AI was used to create the method usage detection and for validating documentation, but everything else is human made!