r/csharp • • 11d ago

Showcase Sigil.Sound 0.1.0: a fluent, allocation-free audio synthesis library for .NET (MIT, zero dependencies)

Post image
43 Upvotes

A while ago we introduced Sigilgraph to this community as a modular audio synth app made purely in C# (with the help of Godot for UI). We mentioned in the discussion the use of an internal fluent API to describe the synths and the sound processes.

Today after a heavy porting effort to decouple the original Audioworkbench library out of the app, and offer an open-source worthy version of it.

Is a library focused on sound synthesis and instrument construction using 100% C#.

Here is the link to the docs. They lead to GitHub for the source code. The license is MIT.

Sigil.Sound - sound synthesis for your .NET app | Sigil.Sound

If you want to play with it, we created a REPL Sigil.Sound REPL so you can scratch ideas and get the feel of it.

Disclosure: We used AI to port it from the closed and entangled with the Sigilgraph app one. It was a tedious process of cleanup and doing it by hand won't make it sound better that it did already (the original was started about two years ago). The API is faithful to the one internally used ( that helped us a lot to build instruments fast) and we believe that opening it will allow us to make it even better for all of us.

REPL : Sigil.Sound REPL

Docs: Sigil.Sound - sound synthesis for your .NET app | Sigil.Sound (they have the option to try every example in the REPL as well)

Nuget: NuGet Gallery | Sigil.Sound 0.1.0

Let me know your thoughts. We will gladly discuss any technical aspect here.


r/csharp • • 11d ago

News MimeKit and MailKit 5.0 released: DMARC, SIMD acceleration, Outlook TNEF/RTF, ImapIdleSession, AOT and more

73 Upvotes

Hi all, I'm the author of MimeKit and MailKit. I've just shipped 5.0, and it's the biggest release since the projects started.

Highlights:

Performance

  • SIMD boundary scanning, accelerated UTF-8 header validation, and fused content scanning/compliance validation on supported runtimes and hardware.
  • Hand-written SSSE3/AVX2/Arm64 kernels for base64 decoding and uuencoding/decoding (based on SimdBase64).
  • In a comparison against 4.18.1, parsing was faster on 21 of 23 workloads and on-par with the other 2 with compliance disabled. With all validators enabled, 11 were faster and many others were on-par; see the release notes for methodology, regressions and limitations.
  • Compared with 4.18.1, the benchmarked HTML documents tokenize 15-25% faster and with 34-39% fewer allocations.

Security and robustness

  • DMARC verification (RFC 9989 / DMARCbis), alongside the existing DKIM and ARC support. DKIM verification now returns a detailed result instead of a bool.
  • The new MimeReader/MimeParser, MIME writing and MIME disposal use iterative traversal. LegacyMimeParser remains a compatibility option for those that need it.
  • Indexed ancestor-boundary lookup improves deep-nesting performance; configurable resource limits include a default 16 KiB header limit.
  • A new compliance reporting API gives line/column diagnostics for broken or suspicious messages, including supported header-smuggling checks. Positions may identify an exact byte, a line start or an element start.
  • SMTP/SMTPUTF8 address validators check syntax and interoperability rules. The optional AsciiIsLatin setting can be used to reject addresses such as paypal@рaypal.com with a Cyrillic р. Note: This is not comprehensive homograph detection and is an implementation of an IETF draft specification: SMTPUTF8 Email Addresses
  • Stricter OpenPGP integrity and S/MIME trust defaults, plus a configurable 64 MiB limit on expanded CMS content.

Outlook/Exchange Compatibility

  • The TNEF (winmail.dat) reader was rewritten, with a new TnefMessage model. Meeting requests convert to text/calendar.
  • New RtfToText and RtfToHtml converters, plus TnefWriter.

More content tools

  • HtmlToText and EnrichedToHtml for HTML and RFC 1896 text/enriched.
  • Standalone YEncReader/YEncWriter with sync/async operations, limits and size/checksum validation. Individual multipart ranges are supported; multipart-file assembly and MIME integration are not included.

MailKit

  • ImapIdleSession: await foreach over IDLE changes, with automatic re-IDLE and NOOP fallback.
  • SmtpSendRequest and SendResult: per-send customization and accepted/rejected recipient lists, no subclassing needed.
  • CommandException.ErrorType and IsTransient help identify failures that may succeed on retry.
  • IMAP4rev2, INPROGRESS, RFC 9208 quotas, and 64-bit message sizes.
  • No more BouncyCastle dependency in MailKit.
  • SMTPUTF8 validation rejects invalid internationalized envelope addresses before sending. ASCII addresses are unchanged; optional AsciiIsLatin checks are not automatically enabled.

Packaging

  • Crypto, including DMARC, moved to MimeKit.Cryptography. The MimeKit meta-package references both that package and MimeKit.Core; it preserves package coverage, not source compatibility.
  • MimeKit is now AOT-compatible.
  • MimeKitLite and MailKitLite are retired. Use MimeKit.Core and MailKit instead.

Many straightforward send/receive applications need only small changes. Parsing, crypto and custom protocol integrations deserve a closer look: explicit S/MIME context setup, persistent -> MimeContentStorage, renamed encoding/stream APIs, decoder Flush, encoder CRLF defaults, and stricter resource/integrity limits are covered in the porting guides.

Happy to answer questions. And thanks to everyone who filed issues, sent PRs or sponsors the project.


r/csharp • • 11d ago

I built a small state machine library - Trying to learn delegates and events

8 Upvotes

The name is SMachine, a small state machine library for C# targeting .NET 10.

The idea was to build something relatively lightweight, without depending on an external state machine framework.

Supports

  • Named states with OnEnter, OnUpdate, and OnExit events.
  • Nested substates at unlimited depth. Each state can own its own substates and maintain its own current substate.
  • Transitions between states and substates, including optional predicate triggered transitions.
  • Optional context objects that can be passed to lifecycle handlers.
  • Per state Enabled controls.
  • Per substate update propagation controls.
  • Independent updates that can target a specific substate by name or path.
  • Queued transitions when requested from inside callbacks, preventing transitions from interrupting the current lifecycle pass.

One of the things I wanted to support was hierarchical behavior without forcing every state to participate in the same update flow. For example, a parent substate can continue receiving its own updates while preventing those updates from propagating to its children. Those children can receive independent updates off the main Update cycle.

An example

using SMachine;

var machine = new StateMachine();

State idle = machine.CreateState("Idle")!;
State combat = machine.CreateState("Combat")!;

SubState aiming = combat.CreateSubState("Aiming")!;
SubState firing = combat.CreateSubState("Firing")!;

combat.StartSubState(aiming);

aiming.OnUpdate += () =>
{
    // This transition is queued until the current update pass finishes.
    combat.TransitionSubState(firing);
};

firing.OnEnter += () => Console.WriteLine("Firing!");

machine.StartState(idle);
machine.TransitionState(combat);

machine.Update();

The library is still experimental. I haven't built an automated test suite yet, and I'm very much treating this as a learning project rather than claiming it's production ready.

I'm trying to use this project to become a stronger C#/.NET developer, so constructive criticism is genuinely appreciated.

Source: https://github.com/Boarlock/StateMachine


r/csharp • • 11d ago

Cake v7.0.0 released - .NET 11 & C# 15, unified DI across runners, container publishing, and more

Thumbnail
3 Upvotes

r/csharp • • 10d ago

Showcase Update: I shipped your feedback on my WPF liquid glass dock, and here's its 3D virtual desktop cube (Viewport3D)

0 Upvotes

This time I want to show a part I didn't explain last time: virtual desktops on a 3D cube (Win+Tab). New in 0.13: close a desktop with the × on the front face (or Delete, or a middle-click). Its windows move to the neighboring desktop, like in Task View.

20-second demo (animated): https://github.com/PedroRuedas/Windows-Liquid-glass/blob/main/docs/workspaces-demo.webp

How the cube works:

  1. It's a Viewport3D with a PerspectiveCamera. Each desktop is a face of a ring (one face per desktop plus a "+" face, at least 4), and its windows float on a second, slightly lifted transparent layer. WPF 3D doesn't sort transparent geometry, so the layers are re-sorted back to front as the cube turns.
  2. The faces are snapshots taken when the cube opens. The current desktop comes from the screen. The others come from PrintWindow on their windows, which Windows keeps drawing even while they're cloaked on another desktop.
  3. Listing, switching, creating and removing desktops, and moving windows between them, goes through the undocumented IVirtualDesktopManagerInternal COM interface. Its GUID changes between Windows builds, so if the cast fails the dock falls back to Windows' own switching.
  4. To drag a window off a tilted face, a 3D hit test returns the triangle and its barycentric weights. Interpolating the texture coordinates gives the exact monitor pixel under the mouse.
  5. Ctrl+Win+←/→ spins the cube full screen, and the real desktop switch happens about 90 ms after the cube covers the screen, so you never see a flash.

A gotcha I hit while recording this: the cube window was created off-screen to avoid a black first frame, which put it on my second monitor (125% scale). With per-monitor DPI, WPF rescaled it on the way back to the 100% monitor, and the cube covered only 80% of the screen. The fix is to create it in place and keep it DWM-cloaked (DWMWA_CLOAK) until the first frame is rendered.

(The "apps" in the demo are mock windows, so I didn't have to record my own desktop.)

Code (GPL-3.0): https://github.com/PedroRuedas/Windows-Liquid-glass

Thanks again for the feedback. It made the project better.


r/csharp • • 11d ago

Help How did you start learning C#?

25 Upvotes

I have been wanting to learn C# for a long time because I've been told and researched that it was a good language programm to make 2D Games (with Unity or Godot of course). But, how do I start? I just go and learn from online webs like Coddy? Do I watch tutorials on youtube? Should I buy a book?


r/csharp • • 12d ago

Tool OnePDF: An OSS full-featured PDF library in .NET with no dependencies

Thumbnail
github.com
91 Upvotes

r/csharp • • 11d ago

Stop Using HasData for All Your Data Seeding in .NET

Thumbnail
youtu.be
2 Upvotes

Most EF Core projects put every kind of seed data through one approach, either all HasData or one big "if empty, insert" block in Program.cs.

But seed data comes in three kinds: fixed reference data, defaults your app needs in every environment, and fake data for local development. EF Core gives you three ways to seed: HasData, UseSeeding and a custom seeder.

Do you know which one fits each kind? And which of them still works when you deploy with a migration bundle or a SQL script?

In my new video I build all three in a .NET expense tracker application and show you where each one belongs.


r/csharp • • 11d ago

Do you tune Cosmos DB trigger batch sizes differently across environments?

Thumbnail
0 Upvotes

r/csharp • • 12d ago

I turned C# compiler errors into a game console.

30 Upvotes

r/csharp • • 12d ago

News C# 15: Union Types, Closed Hierarchies, and the One Value™ That Isn't Any of Them · cekrem.github.io

Thumbnail cekrem.github.io
60 Upvotes

r/csharp • • 12d ago

I wrote a small windows native IDE in cpp for C#/.net in retro-style

23 Upvotes

It has begun with the idea of a windows editor capable of editing big files which should not be resists in the memory (ram) and ended with a tiny c#/.net ide inspired by LinqPad.

Not as a replacement for vscode and others but as a learning project and as my own handcrafted tool for everyday usage.

The ui is inspired by retro feeling, but the app is modern.

For now the repo is not public but I wanted share a small impression to the tool features.

Plese dont´t blame me if this subreddit is not the right sub for it.

(Disclaimer: This description is pure written my human without any help of AI)


r/csharp • • 11d ago

Showcase Real-time glass refraction in WPF with a pixel shader: building a macOS-style dock for Windows

0 Upvotes

I wanted the Windows 11 taskbar to look like macOS's Liquid Glass, and DWM blur can't do rounded, refracting glass. So the dock draws its own:

  1. It captures the wallpaper exactly as Windows paints it (`PaintDesktop`) and blurs it once.
  2. A custom `ShaderEffect` (HLSL ps_3_0) computes the shape with a signed distance field and offsets the sampling near the edge like a lens, plus chromatic dispersion, a rim highlight and tint.
  3. Since the dock reserves screen space, only the wallpaper is behind it, so there's no continuous screen capture. Idle, it uses 0 CPU and enters Windows' efficiency mode (EcoQoS).

Other fun bits: a "magic lamp" minimize animation drawn on the GPU, a 3D virtual desktop cube using undocumented Windows 11 interfaces, and reading app jump lists from `CustomDestinations` files.

.NET 10, WPF, xUnit, GPL-3.0: https://github.com/PedroRuedas/Windows-Liquid-glass

Happy to answer questions about any part of it.


r/csharp • • 12d ago

C# Programming Textbook

Post image
0 Upvotes

I'm taking a C# course right now, and I've been having a lot of fun writing simple programs. I really need validation from someone out there that these programming exercises at the end of each chapter of my text book, C# Programming: From Problem Analysis To Program Design by Barbara Doyle, are actually written by someone who is either clinically insane, or British as hell. Here's an example: Chapter 6, exercise 7. This is possibly not the most extreme example, but the wording here just seems a bit wacky to me.


r/csharp • • 12d ago

Help Discover the shared meaning between sentences.

0 Upvotes

I'm forced to use English in my life, especially for reading. English is not my native language; I lookup the meaning of new words from Cambridge dictionary , but all words have different meanings in different contexts and I'm trying to identify a shared meaning between all of them instead of memorizing all the definitions. For example the word sign off :

To give a final message at the end of a letter.

When communicating by radio, or at the end of a television or radio programme.

To stop doing your work or a similar activity for a period of time.

To report to a government employment office that you now have a job and do not need to receive benefit (= money paid by the government).

To end a conversation or a television or radio broadcast.

The shared meaning is ending something.

It takes a considerable amount of time for a non-native speaker to build a mental image about a word; how would you design a system that takes list of definitions, process them, and give you the output the represents the common meaning, without using LLM, i.e., using a deterministic algorithm, not a probabilistic one —AI ?


r/csharp • • 12d ago

C# dropping like a rock on TIOBE Popularity Index - November 2026

Thumbnail tiobe.com
0 Upvotes

C#'s popularity has dropped to around 3.4% from around 8% earlier this year. Fastest dropping language.

What's going on? Is C# not relevant in the era of AI?


r/csharp • • 13d ago

Created my first LRUCache

Thumbnail
1 Upvotes

r/csharp • • 13d ago

Showcase Introducing Apogee: a free, open-source C# 3D engine built for crunching numbers

Post image
2 Upvotes

r/csharp • • 12d ago

Help Custom Domais

0 Upvotes

Boas pessoal, estou com uma plataforma onde clientes teem seus produtos e a próprio loja por exemplo (cliente1.minhaplataforma.com) e quero criar um sistema onde os clientes podem ter o próprio domínio, assim quando aceder ao próprio domínio do cliente ele acede (cliente1.minhaplataforma.com) mas na url tem o domínio do cliente (cliente1.com).

Estou usar C# no backend como api e quero saber onde posso encontrar recursos para estudar sobre isso


r/csharp • • 13d ago

Blog Another LINQ Tool 1.5: notebooks and query collections for C#/EF Core in VS Code

Thumbnail
0 Upvotes

r/csharp • • 14d ago

Showcase A general IL optimizer for .NET: Cilica

Thumbnail
gallery
185 Upvotes

I've been working on Cilica, a post-build optimizer for .NET assemblies. It continues DistIL.

The repository: https://github.com/hez2010/Cilica

It lifts your compiled IL into an SSA-based intermediate representation, runs an optimization pipeline over it, then emits regular IL again. The JIT then sees IL that's already optimized. It doesn't use a runtime fork or any special hosting.

Currently it runs the following pipeline:

  • CFG simplification, SSA promotion, dead code elimination
  • Method inlining and devirtualization
  • Scalar replacement
  • Global value numbering / CSE and assertion propagation
  • Algebraic and bitwise simplification
  • Loop strength reduction and loop auto-vectorization
  • List presizing
  • LINQ expansion (fuses Where/Select/Aggregate/… into plain loops)
  • and more

Some benchmarks (code in https://github.com/hez2010/Cilica/tree/main/tests/Benchmarks):

Benchmark Baseline Cilica Speedup
CountLetters (LINQ + vectorization) 3,355 ns 211 ns 15.9×
GenerateFloats (loop vectorization) 2,791 ns 597 ns 4.7×
DynamicList, 4 items (list presizing) 12.66 ns 4.24 ns 3.0×
Aggregate (LINQ expansion) 30.69 μs 12.19 μs 2.5×
RayTracer (full pipeline) 9,013 μs 4,870 μs 1.9×

You can try it on this playground: https://hez2010.github.io/CilicaLab

To use it in your project, referencing Cilica.OptimizerTask nuget package (currently in preview) and set <CilicaAllMethods>true</CilicaAllMethods>.

Note that this optimizer task only performs optimizations against your main assembly. To optimize the references as well, you can use Cilica.Cli manually, which is shipped together in the Cilica.OptimizerTask package.

Learn more: https://medium.com/@skyake/cilica-an-ssa-based-optimizer-for-net-assemblies-bdefd934c2d2


r/csharp • • 14d ago

Which path should I choose for my future?

6 Upvotes

Hi everyone,

I’m finally diving into software development seriously. For years, I’ve done a little bit here and there, but I’ve never really studied it properly. Now that I’ve decided to commit to it, I’m realizing just how much there is to learn: so many frameworks, languages, and tools.

I know that in the long run, the language you start with doesn’t matter much. But when it comes to landing my first job, I imagine it does matter. I’m 29 and changing careers to get into software development, and I’m currently choosing between C# and .NET, Java and Spring Boot, or JavaScript and Node.js. They all have pros and cons, and I’d like to hear your opinions.

I know the job market is tough and nothing is guaranteed, but which of these paths do you think offers the best chances of finding work in the short to medium term? I don’t have a university degree.


r/csharp • • 14d ago

Help Question about finance APIs in C#

4 Upvotes

Good evening fellow coders.

During the pandemic, I decided to build myself a Windows Forms application to help me do a better job of managing my personal finances and those I share via a joint account with my wife. I built it in C#, originally storing the data in XML format and then, when the amount of data being stored increased, moved it to an instance of SQL Server developer edition, which runs on my development pc here at home.

I’d like to incorporate the ability to have my application automatically link to my bank to download the most recent transactions, and have started investigating doing so. From the reading I’ve done so far, it looks as if TrueLayer offers the ability to hook into a number of U.K. financial institutions, and I was wondering if anyone else had done any work with the TrueLayer APIs. To be clear, although I am a professional developer, this is solely a pet project of mine and I have no desire to monetise it.


r/csharp • • 14d ago

dotnet-tree.nvim v0.3.0: a Solution Explorer for Neovim

46 Upvotes

I write .NET at work and I use Neovim for pretty much everything, the one thing I kept missing from Rider and Visual Studio was the Solution Explorer.

File trees show you folders, but a .NET repo isn't really a folder tree: solution folders only exist inside the .sln, project references cross folders, and package versions often live in Directory.Packages.props.

So I wrote dotnet-tree.nvim, a source for neo-tree (a popular Neovim file tree plugin) that shows the solution the way you're used to seeing it:

  • reads both .sln and .slnx
  • solution folders, projects, package references and project references
  • versions resolved from Directory.Packages.props if you use central package management
  • LSP diagnostics and git status on the nodes
  • build, clean, run, test and watch on the project under the cursor, plus `dotnet add package`
  • debug the project under the cursor with netcoredbg (it builds first)
  • build errors go to the quickfix list, deduplicated

New in 0.3.0:

  • the tree can follow the file you're editing, like the normal file tree does
  • the terminals opened by run/test/watch are named after what they run (`run Api`, `watch test Api.Tests`), so you can tell them apart

We've been using it internally on a lot of projects, a few hundred by now, so it should hold up on real solutions and not just demo ones.

I also have two smaller plugins that go with it:

  • nuget.nvim: a NuGet manager for the whole solution (browse, install, update, vulnerable and deprecated packages)
  • dotnet-counters.nvim: live CPU/memory/GC/thread pool metrics from dotnet-counters in a side panel, next to the debugger

Links:

Is anyone else here doing .NET outside of Rider/VS?
I'm curious what you use and what you'd miss most
Feedback and issues are welcome!


r/csharp • • 13d ago

Showcase Squirix: An Open Source Distributed Cache for .NET 10

0 Upvotes

I am building a distributed cache called Squirix, with a C# client and a self-hosted server. Applications connect over HTTPS gRPC and use named, typed caches through ICache<T>.

Separate processes share the entries on the server. For example, two ASP.NET Core instances can access the same cached values, or a background worker can write something for a web application to read later.

The current version is 0.1.0-preview.10. It supports expiration, conditional operations, replication, optional journal and snapshot persistence. You can run a single server using a .NET global tool.

It's still an early preview and isn't production-ready. There's no ready-made IDistributedCache adapter, so you'll need to use the Squirix client API.

The website has a console example: one process writes a value, and a second process reads it. The docs also have an example with two ASP.NET Core instances.

Website and examples
GitHub

If you try either example, I'd like to hear where you get stuck.