r/csharp 4h ago

Showcase Streamlining .NET Data Layers with ByteAether.Ulid v1.4.0 (EF Core, LinqToDB, Dapper Support)

Thumbnail
github.com
0 Upvotes

A Universally Unique Lexicographically Sortable Identifier (ULID) is a 128-bit identifier designed to address database indexing issues inherent to random UUIDs/GUIDs. It pairs a 48-bit millisecond timestamp with 80 bits of randomness, encoded using Crockford's Base32 string format (26 characters).

Unlike standard GUIDs (e.g., UUIDv4), ULIDs preserve chronological ordering. This prevents B-tree index fragmentation and page splits during high-volume database writes, while retaining global uniqueness without central ID authority bottlenecks.

  • GUID Example: c8a411ec-29fa-4740-9a3b-185d26a2f7c0 (Random, non-sequential)
  • ULID Example: 01ARZ3NDEKTSV4RRFFQ69G5FAV (Timestamp prefix + random suffix, lexicographically sortable)

What's New in ByteAether.Ulid v1.4.0

While the core ByteAether.Ulid engine provides a zero-allocation, lock-free, spec-compliant implementation for .NET, mapping custom primitives to relational databases previously required custom value converters and endianness handling.

The v1.4.0 release shifts focus to first-class data access layer integration. It introduces dedicated companion packages for EF Core, LinqToDB, and Dapper to handle serialization, storage formatting, and endianness alignment out of the box:

Solving Storage Layouts & Database Engine Alignment

Database engines evaluate 128-bit storage types and byte alignments differently. The companion packages support four explicit UlidStorageFormat strategies to ensure efficient indexing across backends:

  • **UlidStorageFormat.Binary**: Persists raw 16-byte big-endian blocks for engines like PostgreSQL (bytea), MySQL (binary(16)), or SQLite.
  • **UlidStorageFormat.String**: Stores the 26-character Crockford Base32 representation (CHAR(26)) for maximum human readability and uniform cross-platform sorting at the cost of higher storage overhead.
  • **UlidStorageFormat.Guid**: Maps directly to standard native 128-bit GUID types (uuid) for systems that handle .NET Guid structures transparently.
  • **UlidStorageFormat.SqlServerGuid**: Reorders internal byte layouts specifically for Microsoft SQL Server uniqueidentifier. Because MSSQL prioritizes bytes 10–15 during index evaluation, shifting the 48-bit timestamp to the end prevents random writes and B-tree index fragmentation.

Fast Time-Range Index Queries

Because timestamp data is embedded directly into the primary key, range queries can target the primary index using boundary tokens:

```csharp Ulid minId = Ulid.MinAt(DateTimeOffset.UtcNow.AddDays(-7)); Ulid maxId = Ulid.MaxAt(DateTimeOffset.UtcNow);

// Translates to an optimized index scan: WHERE Id >= @minId AND Id <= @maxId var recentOrders = await context.Orders .Where(o => o.Id >= minId && o.Id <= maxId) .ToListAsync(); ```

Links & Resources

(The code for this project is entirely hand-written. AI was only used to brainstorm/draft text and generate raw media assets, which I then manually polished.)


r/csharp 12h ago

Deploying AI agent to buildserver?

0 Upvotes

In my company I'm in charge of building multiple AI agents:

- code review (only comments for now, eventually directly fixing small things like typos in naming)

- code gen (we have vertical slice architecture so simple repetitive things like enabling business directly setting master data from frontend requires like 45+ files / about 3-4h of dev work)

-pentesting agent

Our infra:

Dotnet backend deployed to multiple IIS depending on project.

Separate Build Server for automatically pulling master branch, building and deploying

Now that it's built and working locally the CTO wants to deploy it to our Build Server. Imo this is a Terrible idea, since prompt injection is possible. I would put it on a small isolated raspberry pi.

How would you set this up?


r/csharp 12h ago

What's the best way to develop your C# programming skills and prepare for the exam?

6 Upvotes

Hi all.

I'm currently studying to become a programmer and work mainly with C# and .NET. During my training, I have already encountered WinForms, LINQ, Web API, ASP.NET MVC, Entity Framework, SQL Server and CRUD operations.

I can do some projects based on the teacher's lessons, but I want to move beyond just repetition to actually understanding the code. I also use AI as a learning tool, but I don’t want to depend on it(at least I try do it alone), but I have an exam soon (At the end of October), so I want to not only pass it, but also better prepare myself for independent work.

Now I'm trying to figure out which way of learning will be more effective.

For example:

- Take a ready-made program or service, such as Steam, and figure out what parts its simplified version could consist of;

- Watch the lesson, and then close it and try to repeat the project yourself;

- Take a completed project and rewrite it from scratch without prompting;

- Specifically add new functions that were not included in the lesson;

Solve small problems separately on classes, collections, LINQ, CRUD and working with a database;

- Receive someone else's code with errors and try to fix it yourself;

- First, write the solution yourself, and only then compare it with the example.

I'm especially interested in how to properly use real-life applications as examples. I understand for myself that it is impossible to repeat Steam entirely for a beginner, but you can try to make a small training version: list of games, categories, search, user library, adding and deleting entries, authorization and saving data.

Would this approach be beneficial, or would it be better to focus on small, individual exercises first?

I would also like to understand what is more important to review before the C# exam. But right now I'm planning to check:

- Variables and data types;

- Conditions and cycles;

- Methods;

- Classes, objects, constructors and properties;

- Inheritance, interfaces and polymorphism;

- Lists and other collections;

- LINQ;

- exception handling;

- Working with files;

- async/await;

- CRUD;

- Entity Framework and database connection;

- Basics of ASP.NET MVC and Web API.

I would be grateful for your advice on the order of study. Particularly interesting is the opinion of people who have already gone through the stage when the code for the lesson is clear, but it is still difficult to write a similar solution completely independently.

I also have several teaching projects. What is more convenient to attach for analysis: a link to GitHub or a ZIP archive?

The main question is: what practical plan would you recommend for someone at my level to gradually move from repeating lessons to writing C# projects on their own?


r/csharp 1d ago

Advice for Learning C#

30 Upvotes

Hi, I'm pretty new to coding in general, and I want to know what the best approach is for learning C#. I've already made a few small projects, but they're very basic, and I don't feel like they've helped me improve that much. Most of the time, I just follow tutorials without really understanding why I'm doing certain things.

I want to become a better programmer and build more complex projects on my own, so I'm looking for advice on the best way to learn C#. Should I focus on making more projects, studying the fundamentals, reading documentation, or something else? I'd really appreciate any tips or recommendations on how to learn more effectively.


r/csharp 2d ago

Showcase I would like to present: Garbage!

Thumbnail
github.com
0 Upvotes

lol, jokes aside about 10 other people and I took a C# class in 2024 and created "Ultimate Dart Tag" a multiplayer game where you shoot other players with darts!

Very buggy!

Yesterday I copied the private repo into my own public one...

check it out!

MAIN REPO

Releses page

Wiki page

Bug/issues page


r/csharp 2d ago

Stop Using Slow Regex + Bonus Scambaiting call

Thumbnail
youtu.be
0 Upvotes

Negative comments are welcome, this is intentionally stupid.


r/csharp 2d ago

.Net or Springboot

0 Upvotes

Hi there, I am young full stack developer in react, node and nestjs. I understand these fully and have done various projects in them for clients and in my internship. I am currently in my undergrad in Software Engineering.

My question is, what enterprise Tech Stack should I choose now ? .Net or Springboot, I have to learn one, i wanna master 1 of these, but which one, considering that I love deep learning model training, agentic Ai development. In terms of clients, job market, or maybe skills. Which one should i go for ?


r/csharp 2d ago

Question about browsing source.dot.net, and the namespace and assembly organization

12 Upvotes

I was trying to go through some synchronization primitives on source.dot.net and it confused me that classes like Semaphore / SemaphoreSlim for example, live under System.Private.Corelib rather than System.Threading. I get that the namespace for these types is still System.Threading. Was there historical reason to this logical grouping or is there some deployment specific or other reasons to this?


r/csharp 2d ago

Help Help getting Codeproject C# WPF sample code

0 Upvotes

Hello, I noticed Codeproject was recently deleted, and I need a sample WPF code from there.

It was a custom WPF dynamic window with the following overlay options: "RoundedMonitor" and "Office."

The "Roundedmonitor" option made a custom client area, and turned the window pink. I've been looking everywhere. If someone could forward it to me, I would really appreciate it. Thank you.


r/csharp 2d ago

I built a game launcher

Thumbnail
gallery
0 Upvotes

I built a game launcher. Full disclosure I don't have much experience with C#, and I had a lot of help from AI along the way. I want to be upfront about that.

The reason I started this is that Windows just doesn't give you a real console experience, and every app that claimed to fix that was always missing something. I'm a single player guy with two kids, and what I actually wanted was simple, suspend my game, sleep the PC, go handle whatever they need, and come back to exactly where I left off. No missed cutscenes, no lost progress. PlayStation rest mode, basically, but on PC. That is a whole another world, Somehow it turned into a full game launcher.

It's not perfect. I'm committed to making it better, and I'd rather do that alongside people who want the same thing I do than keep building it alone in a corner. So today I'm releasing it for anyone who wants to try it. This started as a project just for me, but I think there's something real here if we build on it together. If you've got suggestions, I want to hear them.

One more thing. I'm a Moonlight/Sunshine user myself, so streaming was part of the design from day one, not an afterthought.

Try it, tell me what's broken, tell me what's missing. I'm here and I'm listening

https://github.com/arkitzson/AperturePortal


r/csharp 3d ago

API proposal: RFC 9457 problem details support in System.Net.Http.Json

Thumbnail
7 Upvotes

r/csharp 3d ago

source.dot.net improvements

Thumbnail
22 Upvotes

r/csharp 3d ago

Help yams exited with code: 1073741515

0 Upvotes

I am trying to make an OS using cosmos and I am trying to compile it for first test but it can't compile because msvc100.dll isn't found how do I make it available again?


r/csharp 3d ago

Help Can someone help me to fix this?

Post image
0 Upvotes

I'm learning ASP.NET Core MVC with Entity Framework Core and I'm having trouble running Update-Database.

I already created the migration successfully, but Update-Database fails with this login error


r/csharp 4d ago

Help Vector/SIMD Questions

16 Upvotes

(1) Why do architecture specific SIMD intrinsics not have ref APIs? I like raw pointers more (after trying refs), but the question still stands.

(2) Should I redefine class vector variables in function scope? Class variables are not readonly. IE: "Vector<float> pSinV = this.pSinV;"

(3) Any way to setup Visual Studio to use a disabled color for SIMD paths that won't execute on my hardware? (Similar to what IF directive does?)

(4) Is "Vector<int>.Count == Vector256<int>.Count" the proper way to check sizes before doing ".AsVector256()"?

(5) For GatherMaskVectorX what should the first parameter be if I don't have an existing vector?

"default" with SkipLocalsInit seems to work

(7) If doing Vector<int> stride clamp of array A & B and saving to C, where A, B, C are aligned.

Would LoadAligned or LoadAlignedNonTemporal be the best option? Assume A & B are Int32 * screen width.

(8) For rendering a texture eight columns at time, I am reliant on,

Avx2.GatherVector256(texturePtr, textureIndex.AsVector256(), scale: sizeof(int))

where textureIndex for a small texture is usually be between [0..128] and usually close

What the proper way (if there is one) to ensure that the texture line is in cache?

(9) What is the optimal approach to uint modulo?

public static Vector256<uint> Modulo(Vector256<uint> value, uint divisor)

{

`// Assumptions,`

`// 1. divisor not POW 2`

`// 2. divisor not constant`

`// 3. value[0..7] can be > (divisor * 2)`

`return Vector256.Create(`

    `value[0] % divisor,`

    `value[1] % divisor,`

    `value[2] % divisor,`

    `value[3] % divisor,`

    `value[4] % divisor,`

    `value[5] % divisor,`

    `value[6] % divisor,`

    `value[7] % divisor`

`);`

}

(10) Same question, but with assumption that all values fit into a ushort. I'm looking at doing quotient in floats, the ConvertToUInt32Native, and MultiplyLow, and Subtract, but seems nasty.


r/csharp 4d ago

OpenTK / OpenGL C# Virtual Machine App | Now with terminals!

Thumbnail
gallery
33 Upvotes

We ignore the third image's resizing kink. I've gotta fix that before I publish this again.
This has taken upwards of a few weeks to get to this point, but I'm loving this. It's the perfect amount of challenge I need right now.


r/csharp 4d ago

Help Course recommendation

0 Upvotes

Hello I want to study C# for my job in the automation industry I don't have little to no experience in coding can someone recommend a helpful course that will let me learn the basics?

Thx


r/csharp 4d ago

Help Book recommendations for beginners

8 Upvotes

I’d really like to get started with game development using Unity, and I know that requires mastering C#. I’m aware there are plenty of tutorials out there, but I learn best from a proper book (and I prefer printed copies). So, my question is: Which books would you recommend for an absolute beginner?

Thanks in advance!


r/csharp 4d ago

Showcase Fuse v4.3, an open source MCP/CLI tool to speed up Claude Code on C# codebases

Thumbnail
0 Upvotes

r/csharp 4d ago

Showcase Who said C# cannot do real-time audio synthesis? I built a programmatic DAW to find out.

86 Upvotes

(Links showing the app in action here and below)

Throughout my career, I have always heard that real-time audio belongs strictly to C++ or native first languages. If you try it in a managed language, people tell you the garbage collector will stutter, the buffer will underrun, and your speakers will crackle.

I am a systems engineer by trade, but I am also an amateur music producer. Over the years, I have used Ableton, Reason, Fruity Loops, Cakewalk, and Max/MSP, but each of them either has a massive learning curve or just feels disconnected from certain forms of music. Traditional DAWs force you into a grid, which makes music sound block-like and square. I wanted to explore more organic, generative possibilities for ambient and electronic music without the massive friction of building a physical Eurorack or writing complex software in PureData.

Originally, I just wanted to build a portable, cross-platform C# library for sound processing. To dogfood it, I decided to embed it in a Godot app. Little by little, I kept building devices until I got carried away and ended up with a programmatic, node-based DAW called Sigilgraph.

Here is exactly how it works under the hood and how a 100% C# engine guarantees it will never underrun the audio buffer.

The Pull Model and Cache Locality

At its core, the synthesis engine is a graph of operators that gets pulled directly by the audio driver. The hard part is giving the driver absolute guarantees that this graph will finish processing in time.

To do that, the entire graph processing needs to live in the CPU cache. You have to avoid heap allocation and heap access completely. The hot path must never allocate objects or arrays. Because of this, the garbage collector is left completely unused 99% of the time, saving it for trivial, low-frequency allocations completely outside the audio loop.

Think about the math for a 96 kHz stereo stream. The engine needs to guarantee that there are always enough samples sitting in a 256-sample buffer at the audio driver level. This means processing at least 192,000 floats per second.

It sounds uninteresting on paper, but those 192,000 floats are traversing a graph of over 100 operators before they hit the driver. We are talking about Fourier transforms, filter s-domain operations, delay buckets, and dozens of oscillators, all offering the opportunity to have their parameters changed in real-time. There is no heavy message passing and there are no extra abstraction layers. Everything is mutated directly in real-time.

To keep things packed tightly in memory, I used structs and Span<T> pervasively, completely replacing standard heap arrays on the hot path. To maintain strict cache locality, the engine processes these spans in blocks and leverages SIMD hardware intrinsics via Vector<T> for heavy lifting like Fourier transforms and intensive add-multiply operations. Think of it this way: instead of a web of heap objects being managed and looked up, the engine uses a pull model where the audio driver pulls samples from the bottom up. The entire graph evaluates as a massive, deeply nested functional cascade up to 200 levels deep on the call stack, constructed using a fluent API builder pattern. To keep this structure stable and prevent cyclic evaluations without introducing overhead, the nodes utilize simple reentrant flags. Live session mutations work by simply appending or decoupling pre-allocated sub-graphs at the block boundaries. This architecture guarantees we never starve the audio driver buffer, avoiding expensive object reconstruction while playing.

The Lambda Trick for Parameters

When it came to connecting the UI to the bottom of the graph operators, I chose to use delegates and lambdas. This was a deliberate compromise for simplicity. I could have used ref float pointers everywhere, but the code would have become incredibly brittle and less idiomatic for C#. Lambdas give us composition and allow for the live replacement of behaviors on the fly.

The trick to making lambdas performant enough for real-time audio is to never evaluate them per sample. Instead, they are evaluated once per block.

By evaluating parameters at the block level, you reduce function calling overhead by 64x. On a standard 48 kHz sampling rate, you only run about 750 parameter evaluations per second (48,000 / 64). This gives you more than enough resolution for smooth parameter changes, and it spares us from having to run a dedicated control signal rail. We just interleave the parameter updates right at the start of the sample block processing.

Picking Your Fights and Profiling

Getting to this point required a lot of deep technical analysis. Tracing tools like JetBrains dotTrace and dotMemory were absolutely essential for this task. Monitoring memory spikes, hunting down hidden GC calls, and doing rigorous hot path analysis was paramount. If you don't profile, you are just guessing.

But the biggest lesson I learned during this project was that you have to pick your battles. You have to let some things go.

While the sample generation and parameter parsing paths are completely locked down and allocation-free, all the note rail and note-passing logic is actually completely garbage collected. Why? Because notes are incredibly small objects and they trigger very infrequently compared to the millions of samples and parameters flowing through the system. Trying to optimize the note-passing system into unmanaged memory structures would have been a massive waste of development time for zero real-world performance gain.

Why C# is More Than Capable

This project completely changed how I look at the C# memory model. It proved to me that modern .NET is an incredibly capable environment for high-performance audio because it gives you the best of both worlds.

It allows for low-level, granular control over memory and hardware instructions where you absolutely need that control, but it lets you drop back into the comfort and simplicity of a managed language for the things that don't matter as much. You don't have to sacrifice productivity to get bare-metal execution speed anymore.

I would love to hear your thoughts on this architecture, and I am happy to dive into the weeds in the comments if anyone has questions about the node evaluation loop, the SIMD operations, or how we profiled the hot paths.

Here is a demo of the project in action: Sigilgraph × VST3 (Trailer #2)
The project page: Sigilgraph Audio Workbench

r/Sigilgraph


r/csharp 4d ago

MerlinORM Library First time posting

Thumbnail
0 Upvotes

r/csharp 5d ago

Sticking to software eng or pivot to cloud?

0 Upvotes

I have been a dev for some time now about 5 years, and my contract ended. I am looking for a new job. I had during my days also worked on DevOps stuff, like managing k8s helm charts and deployments, managing Jenkins pipelines, AWS CDK and CloudFormation etc. on top of doing software dev only.

Now I have 2 offers from different companies, one as .NET dev also working on apps deployed in AWS EKS, and the other as a cloud/platform engineer working with Azure, AWS and k8s. Compensation is roughly the same.

I am unsure now. On the one hand I like product dev and especially that I get to do focused work/deep thinking time without getting disturbed constantly by issues. For the platform role they cautioned me that there will be a lot of context switching since I will have to deal with such different workloads. Also with cloud engineering I feel there is less safety due to lack of automated tests like we have for software, like sure there are lintwrs etc. but in the end it relies more on manual testing in Development env. anf so there is more room for failure. Also there is the on call aspect which scares me a lot.

But on the other hand I see that with AI, I feel the competition down the line later will be much higher for software eng in comparison to platform eng, and it feels like a more safe career in the future. Also since I work multi cloud I can be eligible for more jpbs. Whereas with .NET I will be pigeonholed with only .NET jobs.

What do you guys think? Any opinions? I am leaning a bit towards the platform side, but I am not sure I fit mentally as the job requires more context switch, more uncertainty and on-call aspects


r/csharp 5d ago

Help Junior coming from low-code .NET backgroun, is this roadmap realistic to get truly proficient?

Thumbnail
0 Upvotes

r/csharp 6d ago

Help Is Scott Lilly's "Learn C# by Building a Simple RPG" still useful in 2026?

Thumbnail
7 Upvotes

r/csharp 6d 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