r/dotnet • • 4h ago

Promotion Not your usual .NET project, a tiny café living in the Windows taskbar (C#, .NET 10 and Avalonia) who said .NET is only for enterprise?

Post image
212 Upvotes

not the usual .NET project, but figured some of you might enjoy it :) I built a tiny cozy café that lives on the Windows taskbar.

I'm a .net software engineer who spends most of his time working on corporate software.

stack is C# on .NET 10, Avalonia for the UI and CsWin32 for the Win32 bits. The trickiest part was keeping it on top of the taskbar without flicker lol, and going away when there's something full screen.

gameplay loop is chill, customers walk up, the barista makes coffee, it rains or snows, and you run the business all from a small panel. you invent drinks, put them on the menu, upgrade your equipment, etc.

Little Window Café on Steam, coming out in a few weeks


r/dotnet • • 1h ago

Promotion Serving Qwen4 from .NET: ~870 aggregate tok/s at 16 concurrent requests, plus 256K-context and quality benchmarks

Thumbnail github.com
9 Upvotes

Hey r/dotnet — I’m the author of TensorSharp, an open-source .NET 10 inference engine for running models locally. I’ve been benchmarking Qwen4-35B-A3B against llama.cpp, vLLM, and SGLang on an RTX PRO 4500 Blackwell.

At 16 concurrent requests, TensorSharp reaches approximately 870 aggregate output tokens/second with 200 ms median time to first token in the tested workload. I also tested long prompts up to 256K tokens and a small quality suite; those are separate tests.

For .NET developers, the integration options are probably more useful than the headline number:

  • Embed the inference engine in a .NET application.
  • Run the ASP.NET Core server host with OpenAI- and Ollama-compatible APIs.
  • Export optional OpenTelemetry traces, metrics, and logs to an existing observability setup.

The GPU measurements use TensorSharp’s native ggml_cuda backend. They measure the complete serving stack, including .NET runtime code and native GPU execution. Weight formats and cache precision also differ between configurations, as detailed below.

The application-level questions I wanted to examine were how quickly a chat UI starts responding, how several simultaneous requests share the server, and whether structured outputs remain usable.

At 16 concurrent requests, the approximate results are:

MetricTensorSharpllama.cppvLLMSGLang
Aggregate output throughput ↑870 tok/s410 tok/s750 tok/s850 tok/s
Median time to first token ↓200 ms1,650 ms260 ms280 ms

Time to first token (TTFT) is the wait before the response starts streaming. Aggregate throughput is the output rate summed across requests.

TensorSharp and SGLang are close on aggregate throughput at concurrency 16. TensorSharp has the lowest median TTFT at every tested concurrency level: 1, 4, 8, and 16. These metrics describe different parts of the user experience: a server can generate many tokens overall while individual requests still wait to start.

For the separate 256K-context test, which measures one long request:

MetricTensorSharpllama.cppvLLMSGLang
Time to first token ↓35 s65 s45 s29 s
Effective prefill ↑7,400 tok/s4,000 tok/s5,900 tok/s9,100 tok/s
Streamed decode ↑106 tok/s76 tok/s103 tok/s105 tok/s

Prefill is the initial prompt-processing phase; effective prefill here divides prompt tokens by TTFT, including serving overhead. Decode is the generation phase after the first token.

SGLang leads long-context prefill and TTFT across 64K, 128K, and 256K, with TensorSharp second. llama.cpp leads streamed decode at 64K and 128K, then drops to about 76 tok/s at 256K. TensorSharp, vLLM, and SGLang maintain fairly steady decode rates across the tested lengths.

For applications that send large documents or retrieved context to a model, the initial wait can matter as much as generation speed. The ~870 tok/s concurrency result comes from a separate workload from these long-context measurements.

I also ran a small quality and output-correctness suite:

TestTensorSharpllama.cppvLLMSGLang
Sanity2/22/22/22/2
GSM8K subset49/5049/5049/5049/50
JSON schema10/1010/1010/1010/10
Tool arguments10/109/1010/1010/10
Multi-turn recall2/22/22/22/2
Retrieval6/66/66/66/6

JSON schema and tool-argument checks are particularly relevant when an application needs to deserialize a response or pass arguments to a function. All four configurations pass the 10 JSON-schema cases. llama.cpp differs on one tool-argument case, which needs investigation before attributing the cause to quantization or the engine.

The GSM8K math result covers 50 questions. These are small correctness checks; larger test sets and longer tool workflows would be needed to assess reliability more broadly.

The model sources and precision settings are:

EngineModel checkpoint / quantizationKV cache
TensorSharpRadixArk Qwen4-35B-A3B-NVFP4, ModelOpt safetensors input; Q8 recurrent projections in this configurationF16
llama.cppUnsloth Qwen4-35B-A3B-GGUF, UD-IQ4_XS variantF16
vLLMSame RadixArk NVFP4 checkpointBF16
SGLangSame RadixArk NVFP4 checkpointBF16

Both checkpoint families derive from Qwen4-35B-A3B. KV cache is the stored attention state used during generation; its precision is another configuration difference here.

These results compare complete serving configurations. They combine runtime, quantization, and cache effects; they do not isolate the performance impact of .NET itself. All performance figures are rounded readings from the attached chart.

For anyone interested in trying it or reviewing the implementation:

I’d welcome feedback from people integrating local inference into .NET applications—especially around the embedding API, ASP.NET Core hosting, cancellation and streaming behavior, or observability. Suggestions for improving any of the benchmark configurations are welcome too.


r/dotnet • • 6h ago

Promotion dotnet-vulncheck: transitive vulnerable packages scanner

Post image
17 Upvotes

dotnet vulnerable packages scanner, extends
dotnet package list --vulnerable --include-transitive
by adding the missing information for vulnerable transitive packages which is: which dependency brings them in.
github: https://github.com/almegdad/dotnet-vulncheck


r/dotnet • • 5h ago

Promotion OneApp 1.1: html/css apps in c# with zero third-party dependencies, on Windows, macOS, Linux, iOS, Android and the browser

6 Upvotes

OneApp is a cross platform .NET app framework with zero third party dependencies. Your app depends on .NET and our own packages and nothing else.

It's not a web view wrapper and there's no Chromium, Skia, HarfBuzz or FreeType underneath. Every layer is written from scratch in c#, from the html parser and css layout to font loading and text shaping, image decoding, the shader compiler, the Vulkan and Metal renderers (with a CPU rasterizer as a fallback) and the accessibility bridges for each OS. The binary calls the OS windowing, input and graphics APIs directly.

You build the UI as html/css components with a c# class behind each one, and bindings, events and css properties get checked at build time. The same components run as NativeAOT apps on Windows, macOS, Linux, iOS and Android, and in the browser on wasm.

A dotnet new oneapp app lists 20 packages and all of them are RecursiveAI.*. The linux-x64 publish is a single 22 MB executable. The same test app on dioxus-native (Blitz) pulls in 426 crates.

Debug builds also expose an MCP server, so a test or a coding agent can click, type, read the DOM and grab pixels from the running app. In the demo video (recursiveai.org/oneapp/) an agent finds a layout bug, fixes the css, hot reloads it and checks the pixels to make sure it's actually fixed.

MIT/Apache-2.0. Code is at github.com/recursive-ai-oss/oneapp-csharp and you can try it with dotnet new install RecursiveAI.OneApp.Templates


r/dotnet • • 8h ago

I built a reactive notebook for C#, and it now runs inside VS Code

Post image
8 Upvotes

r/dotnet • • 20h ago

Promotion Runtime async in WASM is now available via NetWasm v0.16 (1.5x faster than Desktop JIT)

47 Upvotes

https://github.com/zion-sati/NetWasm

Been a month since I last updated here and a lot of improvements have gone into NetWasm. Let's start with a little intro for those who are new.

NetWasm compiles C# straight to one standalone WebAssembly file: no Mono, no dotnet.js, no CLR inside.

Version 0.16 compiles .NET 11's runtime async, which Microsoft's own WebAssembly runtime can't run yet, and on async workloads it beats desktop .NET.

Runtime async, in WASM, before Microsoft

For as long as C# has had async, Roslyn has turned every async method into a state machine class: fields for every local, a MoveNext switch, a builder. .NET 11 changes that. With runtime async, the runtime itself suspends a method and resumes it in place, and the compiler emits the method almost as written.

On .NET 11, Blazor WebAssembly runs on Mono, and Mono can't run runtime-async methods (https://github.com/dotnet/runtime/issues/137984). NetWasm 0.16 compiles every async method in your project with runtime async, .NET's own libraries included, on its own suspension runtime, in the browser and under WASI.

NetWasm async faster than desktop .NET

I measured 23 async scenarios in three groups. The first is async patterns: awaits, Task.Yield, WhenAll, IValueTaskSource, async iterators, and exceptions thrown ten frames deep. The second is CoreLib's own stream loops and SemaphoreSlim. The third is libraries: System.Text.Json over a stream that suspends on every read, pipes, channels and DeflateStream.

Share of the other runtime's time NetWasm takes (geometric mean, lower is faster)Mono AOTDesktop .NET 11 JITDesktop .NET 11 NativeAOT
Async patterns (11)0.090.490.57
CoreLib streams, SemaphoreSlim (6)0.310.840.98
JSON, pipes, channels, Deflate (6)0.390.801.14
All 230.180.640.79

This is all a fair fight. Desktop runs runtime async too: its libraries ship compiled that way, and the benchmark turns it on for the workloads' own code. The desktop JIT runs with tiering off, so both sides run optimized code from the first call. The numbers are medians of 15 runs on an Apple M1 Max, with NetWasm under Wasmtime.

NetWasm doesn't win everywhere though. It beats the JIT in 15 of the 23 scenarios and NativeAOT in 13. On JSON, pipes, channels and Deflate, NativeAOT's still ahead.

For more details, see https://www.netwasm.com/micro-benchmarks/ (filter family by Async workloads)

Avalonia 12, unmodified

While runtime async is the headline, the bigger change for anyone shipping an app is that NetWasm now compiles packages you find on nuget.org.

Some of you here have requested for this specifically -- Avalonia 12, with Skia, compiled XAML and the Fluent theme, compiles straight to WebAssembly with no changes to Avalonia. Its headless platform renders the same frame as desktop .NET, pixel for pixel, on wasm32 and wasm64, in Debug and Release. SkiaSharp and HarfBuzzSharp ship native static archives for .NET's WebAssembly SDK, and those link into the program exactly as they ship. Multi-assembly Avalonia applications compile too.

A NetWasm project targets net10.0-netwasm, a .NET platform target framework like Blazor's net10.0-browser. NuGet restores each package's normal `net10.0`, `net8.0` or .NET Standard build, so a package doesn't need a NetWasm build of its own.

I took the 100 most-downloaded nuget.org packages that ship a .NET Standard build and ran each one's README quick start. 56 run unchanged. Most of the rest stop on run-time reflection, which NetWasm leaves out on purpose. Several of those have a source-generated replacement that works.

First to WASI 0.3 ahead of Rust

NetWasm targets WASI 0.3, so the same compiler builds backend services. A project can read files, open sockets, and serve HTTP that wasmtime serve, Spin and wasmCloud run as-is. SslStream runs over wasi:tls, so HttpClient does pooled HTTP/2 over TLS, and wss:// WebSockets work. The HTTP service template, with .NET's whole HTTP stack, is a single 1 MB component, 251 KB with Brotli.

Debug it by C# line

A Debug build now carries DWARF. When a Wasmtime run traps, the backtrace names your C# frames as App.Program.Fail at Program.cs:17. LLDB under Wasmtime sets breakpoints on C# lines and steps through them.

Still small, still fast

The template app that prints 42 publishes to 26,444 bytes, precise GC included. Rust's size profile builds the same WASI 0.3 component at 63,528. Across 2,389 micro-benchmark cases, from dotnet/performance and NetWasm's own, NetWasm runs more than three times as fast as Mono AOT on the same Wasmtime. David Fowler's DoomSharp renders about 1.4 times as fast as its Blazor AOT build, from a ninth of the download.

Thank you to this amazing subreddit

Thank you all for shaping NetWasm as a product and providing me with a lot of useful pointers such as using SatoriGC, testing it out and filing bug reports. Please continue to do so! I'm very grateful and highly value all your feedback.


r/dotnet • • 10m ago

Question Anyone self-hosting ASP.NET Core apps on small Linux servers? How do you monitor them?

1 Upvotes

I'm developing StatLite, an open-source (MIT) application monitoring dashboard that runs as a single Go binary with SQLite and uses around 15 MiB of RAM at idle.

It provides HTTP request rates, errors, latency, historical charts and elevated server error detection without requiring a Prometheus server or Grafana.

It currently supports several Java, Python and Node.js frameworks. I'm considering adding an ASP.NET Core integration recipe if there's interest.

I'm curious what people currently use for monitoring smaller self-hosted .NET applications and whether something like this would be useful.

GitHub: https://github.com/PVRLabs/statlite

Live demo: https://pvrlabs.xyz/statlite/demo.html

Edit: I mentioned Linux because that's the environment I'm primarily targeting, but StatLite can consume metrics over HTTP regardless of the application's operating system and StatLite itself works on Windows too. I'm interested in hearing from Windows users as well.


r/dotnet • • 3h ago

Rider on Mac .net 11 Blazor WASM hot reload not working

0 Upvotes

Anyone else finding hot reload on a .net 11 Blazor wasm app not working with Rider for Mac (latest version)?


r/dotnet • • 3h ago

Promotion Burn It After v1.0: one-time secret sharing on .NET 10 (Blazor WASM couldn't do the AES-GCM I needed)

0 Upvotes

I just shipped a side project, Burn It After (https://www.burnitafter.com), for sending passwords and API keys through one-time links. It's built on .NET 10 with ASP.NET Core.

My plan was to use Blazor WebAssembly so I could keep everything in C#. The problem: the whole point is that the server never sees the plaintext, so encryption has to happen in the browser (client side), and AES-GCM in System.Security.Cryptography throws PlatformNotSupportedException under browser WASM.

So I kept ASP.NET Core on the server and moved the crypto to client-side JavaScript using Web Crypto:

* AES-256-GCM encryption in the browser before anything is sent
* The key lives in the URL fragment (after the #), which browsers never send to the server, so the server only stores ciphertext
* Optional custom password, using PBKDF2 to derive the key
* The message is deleted on first read, and 3 wrong tries locks it for 5 minutes
* Optional recipient verification with a 6-digit email code

The server side stayed nice and boring C#: storage, expiry, lockouts, email, with a decent unit test suite around the core logic.

I also wanted to see how cheaply I could run something like this in production, so instead of a big cloud provider it's hosted on MonsterASP.net with SQL Server for storage. Both have been very economical. The server only stores small encrypted blobs and deletes them once they're read or expire, so the database stays tiny and the load is light.

Has anyone gotten AES-GCM working in Blazor WASM without dropping to JS interop? Feedback on the approach is welcome too. (Disclosure: I built it.)


r/dotnet • • 14h ago

C# just beat SolidJS and Vue 3.6 Vapor in WebUI!

Thumbnail reddit.com
6 Upvotes

r/dotnet • • 4h ago

Eu construí uma cascata de swap de código aberto para WSL2 que usa a VRAM ociosa da GPU como um cache de leitura comprimido na frente de uma origem NVMe (via AF_VSOCK e /dev/dxg, sem TCP)

Thumbnail reddit.com
0 Upvotes

r/dotnet • • 5h ago

Promotion FinallyForms 0.12: I just wanted a WinForms Properties splitter that stays put. Things escalated.

0 Upvotes

It all started with a tiny, almost silly thing. Every time I went back to the Properties window, its splitter had slid almost all the way to the right, and I had to drag it back to the middle. Again. And again. And again.

That was just annoying, though. What I really dreaded was opening a form and finding an exception where my controls should be. "What did I break this time? And how on earth do I fix it?" I don't know about you, but that one seriously freaks me out.

One day I'd had enough and decided to build my own little designer. It went great – my shiny new splitter never moved a single pixel without my permission. But then things escalated – the ideas kept coming. One after another (even in pairs, sometimes). And I just couldn't resist – I stuffed them all in.

Somewhere along the way I polished it so much, and grew to love it so much, that I thought other people might like it too. So I made a website for it, and now I'm putting it out there for anyone who suffers the way I did.

A few things I personally love most about FinallyForms:

  • All my forms at once – live thumbnails of every form in the project. When I'm looking for a form I can polish a bit more, this gives me a quick overview. Just a gimmick, some might say. Maybe – but a pretty one.
  • The eyedropper – I click through the running app, deep into its guts, so deep I don't even know where I am anymore. But the eyedropper knows, and one click shows me that control in the designer. Good eyedropper!
  • All the texts – every text on a form, or in the whole project, with search, replace, export, import and translations. What more could I want?
I really didn't know when to stop – and I haven't stopped yet. My idea list is still pretty long.

FinallyForms is a standalone app for Windows 10 and 11 that works on your existing .Designer.cs files (.NET Framework 4.8 and .NET 8+), and it opens your forms right from Rider, Visual Studio or VS Code. Version 0.12 is out, and it's free during the beta: https://finallyforms.dev After 1.0 it will be paid, with a 30-day free trial.

And what's the one feature you've always wished a WinForms designer had? Let me know – my idea list always has room for one more. If you actually take it for a spin and send useful feedback (a bug, an idea, or something you're missing), I'm giving a free 1-year license of 1.0 to the first 50 testers, one per person. Just use Settings → About → Send Feedback in the app.

P.S. About that exception from the beginning: when a control can't be created, FinallyForms puts its nearest base type in its place, the rest of the form keeps working, and a Check tells you which control failed, why, and where. And forms built on generic base classes? They simply open – no workaround class needed.


r/dotnet • • 2h ago

I got tired of writing every Interactive Auto service 3 times, so I built a source generator for it (Blazor.AutoGen 1.0)

Thumbnail reddit.com
0 Upvotes

r/dotnet • • 13h ago

BlazorDX 0.7.0 Released

Thumbnail blazordx.com
2 Upvotes

r/dotnet • • 1d ago

Union types C#

18 Upvotes

I think the union types will really come in handy when it comes to handling http client responses for most integrations. About to get rid of all my ResultOfT custom implementations 💯


r/dotnet • • 13h ago

Promotion Lazy Sequence Generator: Bronskiy.Sequences

0 Upvotes

Hi, everyone!
I've been working on Bronskiy.Sequences, a small NuGet library that allows you to generate lazily evaluated sequences from functions.

Code example

using Bronskiy.Sequences;
    
// Index based generation
IEnumerable<int> oddNumbers = Sequence<int>.Generate(1, 5, 2, index => index); // 1, 3, 5, 7, 9
    
// Seed based generation
IEnumerable<int> powersOfTwo = Sequence<int>.Iterate(5, 1, value => value * 2); // 1, 2, 4, 8, 16 
IEnumerable<string> words = Sequence<string>.Iterate(3, "a", value => value + "a"); // a, aa, aaa

I would appreciate it if you could review the API of the library or suggest new features!

Links


r/dotnet • • 14h ago

Native UI framework XML prototype with Win32

Thumbnail gallery
0 Upvotes

For those who remember my post about new C# + XAML/XML-like UI, I decided to build the core in C++ (so I can call NDK in Android, other OSes)

Anyway. This here calls Win32 UI components (1st screenshot defaults to Win95/98, 2nd takes on UxTheme of OS im on so Windows 10).

I'll expand on OS-drawn components as much as I can, and for everything else use Canvas to draw things like WinUI does. Devs will get a choice what they want to use (obviously pure Win32 will have limited choices).

I haven't yet figured out if I can mix-and-match native + Win32, but native would just be boxes of canvas anyway so once layout if calculated we could probably allow that, but I'll see

Anyway. The UI framework will be messy (lots of ways to do 1 thing) but at least devs will have all the choices to make their programs look however they want!

Last post for those interested: https://www.reddit.com/r/dotnet/comments/1xtaerv/new_cxamlish_ui_framework_in_planningstage_inputs/

PS: this is my play-project after work hours, so don't expect lightening fast progress -.-


r/dotnet • • 10h ago

Promotion Microservices or monolith: should that decision live in your code at all? How do you handle it?

0 Upvotes

How do you decide when a module gets its own service, and how often did you have to undo that decision later?

I keep running into the same pattern. A team splits a monolith, ends up with a distributed monolith, and spends a year merging things back (Segment's "Goodbye Microservices" is the famous one). Or a team stays monolithic, and when one part really needs its own process, extracting it is a rewrite.

The best explanation I have found is a Google paper, "Towards Modern Development of Cloud Applications" (Ghemawat et al., HotOS 2023): microservices mix two boundaries. The logical one, how the code is structured, and the physical one, how it is deployed. While they coincide, every "let's split" or "let's merge" is a code change. Google's own answer, Service Weaver, went into maintenance mode in 2024, partly because adopting it meant rewriting existing apps.

What we do (disclosure: the runtime is my own open source project, redb.Tsak, Apache 2.0):

  • code is cut into modules along DDD bounded contexts, and a context never spans packages;
  • which module runs in which process is configuration: one worker with every package is a modular monolith, one package per worker gives you microservices, a cluster of workers adds failover;
  • inside one process modules talk through an in-memory queue; when one moves out, the address in config changes from vm://orders to rabbitmq://orders or kafka://orders, and the route code stays the same.

We run all three shapes in production: one project as six packages on four workers talking through RabbitMQ (a test fails if a module references another module directly), one as a single worker with two modules, one as a three-node cluster.

What it does not solve, and I would like to hear how you deal with these:

  • modules in one process share failures: a memory leak in one hurts its neighbours;
  • a call that was synchronous inside a process stops being synchronous over a broker, so modules that might move apart should talk asynchronously from day one, which costs something even if they never move;
  • a shared database is convenient while everything sits together, so we only let the owning module write to its schemes.

So, questions for you:

  • What makes you carve out a service: team, load, security, domain?
  • Do your service boundaries follow bounded contexts, or did they grow on their own?
  • Have you merged services back, and what pushed you to do it?
  • How do you debug a chain of several services on your own machine?

Repo: https://github.com/redbase-app/redb-tsak


r/dotnet • • 23h ago

C# file-based apps are a breath of fresh air

Thumbnail reddit.com
0 Upvotes

r/dotnet • • 23h ago

Promotion What actions have you made for Post-quantum cryptography (PQC) in your .NET app?

0 Upvotes

Considering NSA Advises Immediate Transition to Post-Quantum Cryptography to Protect National Security Systems, I had some code that signs responses with Elliptic Curve Digital Signature Algorithm (ECDSA), and well... NSA thinks that's unsafe now.

The following GitHub commit shows how you can implement RFC 9964: ML-DSA for JSON Object Signing and Encryption (JOSE) and CBOR Object Signing and Encryption (COSE) into ASP.NET Core middleware to create JSON Web Signatures (JWS):

introduce RFC 9964: post-quantum ML-DSA-65 (FIPS 204) signatures for … · erwinkramer/bank-api@66463c8

What actions have you made, or what actions are you going to make in this new world?


r/dotnet • • 2d ago

fibakit - C# Script (file-based apps) building blocks

Thumbnail github.com
12 Upvotes

First: It isn't much yet, and yes - anyone could do this.

In search for simple building blocks for scripts written in C# i created this repo. I needed a simple-to-use argument parser and added it there. Files are just copied into the repo where they are needed - no package management.

If you have feedback or ideas for similar components that could be useful, feel free to contribute.


r/dotnet • • 3d ago

I'm a frontend developer who asked my manager for a chance to work with .NET, and he said yes!

59 Upvotes

Hey everyone!

I've been working as a frontend developer for several years, mainly with React and TypeScript.

Recently, I asked my manager for an opportunity to work on the backend with C# and .NET. He was very supportive and encouraged me to take this step.

Over the past three months, I've been learning C# and .NET, but I only know the very basics. I've never worked with databases in a real project, and I have no hands-on experience with technologies like PostgreSQL, Redis, or RabbitMQ.

I'm supposed to start working on my first backend task next week. I'm really excited about this opportunity, but I'd be lying if I said I wasn't nervous.

Has anyone here been in a similar situation? Were you able to learn on the job with such limited backend knowledge?

I'd love to hear your experiences and any advice you might have.

Thanks!


r/dotnet • • 1d ago

Question where's the publish button?

Thumbnail gallery
0 Upvotes

I'm trying to compile a program to extract files from Quake Champions but whenever I go to publish it, there's no publish button despite what the creator said. if you need more information plz ask as I don't know what's wrong


r/dotnet • • 3d ago

Question Is .NET still one of the most future-proof tech stacks?

149 Upvotes

With everything happening around .NET, C# and cloud-native development, the ecosystem keeps moving forward. If you were starting today, would you pick .NET again? Why or why not?