r/dotnet • u/god_of_tits_an_wine • 1h ago
Introducing DocumentExtractionClient (preview): Extract documents in .NET
r/dotnet • u/god_of_tits_an_wine • 1h ago
r/dotnet • u/alexyakunin • 15h ago
I'm curious which low-level subsystems actually eat the CPU in real production clusters. If you've profiled your services (dotnet-trace, a continuous profiler, flame graphs from Datadog / Pyroscope / etc.), what were the biggest chunks?
Some examples of what I mean:
Dependency injection. ASP.NET Core builds a scope per request, and depending on how your services are registered, a decent part of the graph may be constructed on every request.
Serving responses. Serialization and deserialization for REST / gRPC, plus routing, middleware, and auth.
Calls to your own backend services. I/O, plus serializing and deserializing the same data again on both sides.
Database access. LINQ translation, materialization, change tracking, etc.
Logging and telemetry.
GC.
Very rough percentages are fine, e.g. "~30% REST/JSON, ~15% EF materialization, ~5% logging, the actual business logic is ~20%".
Also interesting: what surprised you when you first looked at that data.
r/dotnet • u/kralmoriaty • 2h ago
I have been maintaining Clean Architecture codebases where the dependency
rules exist only in a wiki, and they rot anyway. So I built RungerHeimdall:
a Roslyn analyzer that enforces the rules at compile time.
What it does
Architecture (8 rules): layers declared in architecture.json, dependency
direction enforced, forbidden types and namespaces, namespace-must-match-folder,
repositories/services must be interfaces, framework allow-list, no static
mutable state, endpoints cannot construct infrastructure types.
Performance (20 rules): 12 deterministic allocation rules and 8 context-aware
ones. Examples: empty params array, ToList() before foreach, string concat in a
loop, struct compared through EqualityComparer<T>.Default (boxes), foreach over
non-generic IEnumerable of value types, Task.Run inside async, async void,
blocking on Task, repeated enumeration, ValueTask awaited twice,
Task.FromResult in a loop, Array.Resize in a loop.
Adoption: heimdall-baseline.json freezes existing violations so you only see
new ones. Temporary exemptions require a reason and can expire.
Hot paths: [HotPath]/[ColdPath], plus framework entry points (controllers,
hosted services, SignalR hubs, Minimal API handlers, Azure Functions,
MassTransit consumers), loops and iterators.
Honesty section: two of my original rules (empty params, Enum.HasFlag)
measured 0 B on .NET 9 because the JIT now removes the allocation. I
downgraded both to info and published the numbers. The benchmark table is at
https://github.com/rungerheimdall/rungerheimdall/blob/main/docs/benchmarks.md
Quick try:
dotnet add package RungerHeimdall.Analyzers --version 1.1.1
heimdall init
dotnet build
Rule reference (filterable): https://rungerheimdall.github.io/rungerheimdall/rules.html
Repo: https://github.com/rungerheimdall/rungerheimdall
Package: https://www.nuget.org/packages/RungerHeimdall.Analyzers
MIT, no telemetry. I am the author. Feedback on false positives would be the
most useful thing right now — that is what kills analyzers.
r/dotnet • u/ShunsukeF • 50m ago
r/dotnet • u/mokapot_1cup • 1d ago
Do you work in a remote setting that allows you to work from anywhere in the world? It's been months I have been searching for a fully remote .NET job, and I need guide on how did you find these companies.
.NET vacancies in my country is almost non-existent and I am targeting for companies that hire internationally.
Any lead would be helpful. Thank you in advance!!
r/dotnet • u/TomeOfExperience • 1d ago
r/dotnet • u/Hudsxn98 • 1d ago
For a while I've wanted a React-style framework and workflow for .NET, and today's the day I've finally got something I'm happy with!
I've been working on two components over the past couple of weeks, both tackling different parts of the problem. They've finally come together, so I thought I'd share what I've been up to.
Donkeh UI is the framework side of things. It has a React-style virtual DOM, with familiar patterns like State(), Effect() and so on. There's also a CLI tool to make some of the repetitive stuff quicker, along with a collection of static helpers for creating HTML elements.
There's a CSS engine too. I've tried to cover as much of the CSS specification as I could, although it's a pretty massive spec, so apologies in advance for anything I've missed xox.
Layout is handled internally as well. I've tried to get things like flexbox behaving as close to the browser as possible, although there's only so much I can do. I'm employed after all ;)
Other bits include a built-in UI testing framework for unit tests, an inspector (think Chrome DevTools, but a little more average) and online documentation.
CSS is responsive, and there's support for borderless windows, fullscreen applications, rounded application corners and even the app-region: drag CSS property, which lets you create your own custom window frames.
I've also spent quite a bit of time trying to keep the CSS engine lightweight. Even with fairly complex applications, memory usage generally sits around 30-40 MB, with relatively low CPU and GPU usage.
Under the hood, the CSS engine uses dynamic code generation for both the CSS tokeniser and media query processing. There's also a fair amount of caching and optimisation going on throughout rule resolution, layout and rendering. The aim was to keep things efficient without having to compromise on what the framework can actually do.
It currently compiles for Windows, Linux, macOS, WebAssembly and Android. I don't have access to Apple hardware to test everything, so iOS isn't something I'm planning to support just yet.
CSX is the other half of this.
It brings JSX-style syntax directly into C#, so you can write your UI components without having to deal with endless nested method calls and object initialisers.
It works by tokenising C# while recognising JSX-style syntax, then transforming it into valid C#. Pretty much the same idea as the JavaScript/JSX transformation pipeline.
There's a bundled language server too, along with VS Code and Rider plugins. Both have a one-command install and provide CSX syntax support, autocomplete, diagnostics and the usual editor features.
And no, I haven't gone and written an entire .NET compiler. I've just piggybacked off Roslyn. Thanks, dotnet team xox.
The whole point was to get something closer to the React development experience into .NET, while keeping the benefits of building applications with C#.
Having both packages working together in an actual application has been really nice to see. There's still plenty I'd like to improve, but I'm pretty happy with where things have ended up.
If anyone fancies giving either of them a go, having a poke around or finding things I've inevitably broken, I'd really appreciate the feedback!
Donkeh UI: https://barely-sentient.github.io/donkeh-ui/index.html
Empty C# JSX Project: https://github.com/barely-sentient/donkeh-csharp-jsx
r/dotnet • u/onurgumusdev • 1d ago
Enable HLS to view with audio, or disable this notification
Records, unions and pattern matching, compiled ahead of time to native 6502 code. No VM, no GC. The whole game, SID music included, is 37 KB on a 1 MHz machine from 1982.
r/dotnet • u/SmallAd3697 • 1d ago
It is 2027 (or almost). We are hosting aspnetcore apps inprocess on IIS. We have tried using file-based deployments to production, and keep encountering errors when dlls are locked/in-use. We also tried the webdeploy approach with offline file for graceful shutdown ("App_offline.htm") but it is unreliable.
Is using shadow-copy still the recommended approach for consistent deployments in 2027? I'm getting really tired of fighting IIS on our production-deployment weekends.
Rick Strahl wrote a blog about this a number of years ago and it seems to keep surfacing as the correct approach for normal IIS deployments every year. I would rather be deploying apps on k8s in linux, but such things are out of my control. So I want to make sure IIS is as smooth as we can make it. Any tips would be appreciated.
Edit. I realize I'm approaching answers with a lot of confirmation bias. Can someone tell me if we should NOT use the shadow-copy deployment mechanism? What are the drawbacks that I might be missing?
r/dotnet • u/Consistent_Serve9 • 1d ago
Now is one of those days where I definitly overthink a problem for not much added benefits. But I do want to see if other people have had this issue and how they handled it.
With this many CVEs detected on dotnet itself in the past few weeks, the need to patch our runtime and our build has become much more important. Our dotnet apis are deployed in containers, built in a multistage build, using the mcr.microsoft.com/dotnet/sdk:10.0 and mcr.microsoft.com/dotnet/aspnet:10.0 images. So far, we don't have a way to know which sdk patch version was used to build the image, and the only way to see what version of dotnet we run in prod is to go on the pod and run "dotnet --version". So, I'm looking for a solution to automate patching and track which version of dotnet is used in each of our environments.
At first, I tough of simply automating our deployment so that we simply rebuild and deploy a new image, assuming that the patched version will be the pulled version. But that doesn't solve the issue of knowing which version of dotnet is used after the fact. But it is quick.
After brainstorming with AI, I'm thinking of using this solution:
Tag the exact patch version (10.0.404 for sdk and 10.0.15 for runtime) in the dockerfile's FROM instruction.
Manage image update using GitHub's dependabot, configuring it to check for a new update daily.
Get the configured versions using these commands in my deployment pipeline:
dockerfile=Dockerfile
runtime_version=$(sed -nE 's|^[[:space:]]*FROM[[:space:]]+mcr\.microsoft\.com/dotnet/aspnet:([^[:space:]@]+).*|\1|Ip' "$dockerfile")
sdk_version=$(sed -nE 's|^[[:space:]]*FROM[[:space:]]+mcr\.microsoft\.com/dotnet/sdk:([^[:space:]@]+).*|\1|Ip' "$dockerfile")
if [[ ! "$runtime_version" =~ ^[0-9][a-zA-Z0-9_.-]*$ || ! "$sdk_version" =~ ^[0-9][a-zA-Z0-9_.-]*$ ]]; then
echo "Expected exactly one versioned .NET runtime and SDK image in $dockerfile" >&2
exit 1
fi4. Add the extracted version numbers as annotations on the image.
I don't like this big command, nor do I like not getting the actual version from the docker image runtime itself, but this is the best solution I found so far. The sdk version used is explicitly defined in the repository with the code deployed, the PR is created automatically when a new patch is available, and I can consult the dotnet version used in every environment by inspecting the image in the container registry. But I don't like that we'll have to managed this process in all of our repositories whenever a new patch is made available (which is quite often these days).
Do you track which dotnet version is used by your containers in your environments? Or do you simply tag the minor version (10.0) and leave it be? Did you have any issues patching your environments because of the recent CVEs? Is this a stupid problem?
Thx for the feedback!
r/dotnet • u/AkiraGTX • 2d ago

Codalus IDE 1.0 is out. It's a free, MIT-licensed IDE for .NET, native on all three desktop OSes, with the classic IDE's layout and keyboard scheme.
What it covers:
C#, VB and F# on Roslyn and the F# language server: refactorings with previews, your analyzers and source generators, and Code Search
A real project system: .sln and .slnx, SDK-style and old-style .NET Framework projects on MSBuild, property pages, multi-targeting and NuGet
Web: ASP.NET Core, .http files, an Endpoints Explorer, and Blazor debugged across the server and the browser
Desktop and mobile: Avalonia (previewer and XAML Hot Reload everywhere), the Windows Forms designer with a Toolbox that reads control libraries' controls, the WPF XAML Previewer, WinUI 3, and .NET MAUI on Android, iOS simulators and Mac Catalyst
Its own debugger: Hot Reload while debugging, inline values, async call stacks, Set Next Statement, Disassembly, Registers and Memory windows
Tests for xUnit, NUnit, MSTest and TUnit, with coverage; profiling with flame graphs and memory snapshots; EF Core migrations and model views; a Database Explorer
Git across every repository of a solution, with a 3-way merge editor, interactive rebase and pull requests on GitHub, GitLab and Azure DevOps
Remote: SSH, WSL, containers and Dev Containers
Aspire and containers with your docker or podman
No telemetry, and AI stays off until you turn it on.
Download: https://codalus.dev/download/ (installers that update themselves, plus apt and dnf repositories). It needs the .NET 11 SDK. The Windows installer isn't signed yet, so SmartScreen asks once.
What's new in 1.0: https://codalus.dev/docs/whats-new/
Source: https://github.com/stavroskasidis/codalus-ide
Feedback is very welcome, especially from big or unusual solutions.
r/dotnet • u/arintonakos12 • 1d ago
For the last 9 months I've been building DataVo, an embedded database written entirely in C# on .NET 10. There are no native binaries, so no P/Invoke and no UTF-8/UTF-16 conversion on every string. It publishes with Native AOT and zero trim warnings.

The idea I kept coming back to: a lot of what a query engine does at runtime can happen at build time. Roslyn source generators and LINQ interceptors turn [DataVoTable] types and [DataVoQuery] methods into code that reads straight out of byte buffers. No reflection, no expression trees compiled at runtime.
Here is what that looks like in practice:
[DataVoTable("players")]
public sealed class Player
{
[PrimaryKey] public int Id { get; set; }
public string Name { get; set; } = "";
}
var players = db.Table<Player>();
// Point lookup. The interceptor rewrites this call site at build time.
Player? p = players.FirstOrDefault(42, static (p, key) => p.Id == key);
// Filtered count over a [Columnar] column, 0 B allocated per call.
int elites = players.Where(1000, static (p, min) => p.Score >= min).Count();The lambdas are static and take their argument as explicit state, which is what lets the generator compile them. If it can't translate one, you get a build warning and it falls back to a slower path that still returns exact results.
Numbers from one Apple M4 Pro, 100,000 rows, BenchmarkDotNet (methodology and raw output are in the write-up):
Primary-key lookup in memory: 55 ns for DataVo, 716 ns for SQLite.
Primary-key lookup on disk (DataVo LSM vs SQLite WAL): 216 ns vs 1,654 ns.
Filtered COUNT/SUM/MIN/MAX over 200,000 rows through compiled LINQ: no allocation, about 9 to 10 times faster than SQLite.
It loses too. GROUP BY over 125,000 groups of an indexed key, unindexed ORDER BY ... LIMIT, and full scans with OR or LIKE are slower than SQLite. DuckDB is faster than both of us on anything that reads the whole table. On a durable write, both DataVo and SQLite wait for the same ~4 ms fsync, so the lookup speedup doesn't matter there.
Other things in 0.4:
Large scans stream in 1,024-row pages. StreamRef() yields stack-only RowRef spans over reused buffers, so it allocates 0 bytes per row after warmup.
Live reactive views built on delta batches (DBSP-style), with SubscribeInto writing into a Memory<T> you own.
VECTOR(n) columns with FLAT and HNSW indexes (SIMD) in the same transaction log.
An ADO.NET provider that works with Dapper.
The disk engine is an LSM with a WAL and memory-mapped SSTables.
What it isn't: not client/server, one process owns the database directory, transactions are snapshot isolation (not serializable), and the SQL dialect is its own.
MIT licensed. DataVo.Data 0.4.0-rc.1 is on NuGet.
Source: https://github.com/ArintonAkos/DataVo-DBMS
Benchmarks, including the losses: https://arintonakos.github.io/DataVo-DBMS/blog/part-1-where-it-wins-and-where-it-loses
If you do Native AOT or local-first work, what's the first query you would throw at it? I would rather get a failing one than a polite reply.
r/dotnet • u/Efficient_Grade698 • 20h ago
r/dotnet • u/Rare-Big-784 • 1d ago
r/dotnet • u/Living-Temporary1133 • 2d ago
I've been building TantivyDotNet, a .NET binding for Tantivy, the search library that plays Lucene's role in the Rust world. It's one NuGet package with the native libraries for Windows, Linux and macOS on x64 and arm64, and it works with trimming and NativeAOT. It targets .NET 10 and later.
You define a schema, index into a directory or into memory, and search with the query parser or with typed queries. Snippets, facets, multi-key sorting with search-after paging and Elasticsearch-style aggregations are in. So is a SearcherManager, for serving many requests from one index snapshot.
On 215k Wikipedia articles it indexes 2-3× faster than Lucene.NET 4.8 and runs term, AND, OR and sorted queries 4-7× faster. Phrase queries are the exception, about 4% slower. The README describes the benchmark setup.
1.0.0-rc.1 freezes the public API, and after 1.0.0 it stays fixed for all of 1.x, so this is the last chance to rename things or change defaults. If any part of the API looks wrong or awkward to you, I'd like to know. I'm also interested in what you'd need before replacing Lucene.NET or a separate search server with it, and in bug reports, especially from containers or less common platforms.
```
dotnet add package TantivyDotNet --version 1.0.0-rc.1
```
Docs: https://aminparsa18.github.io/TantivyDotNet/
Repo and issues: https://github.com/aminparsa18/TantivyDotNet
r/dotnet • u/Turbulent_County_469 • 2d ago
(Posting again, on the right time of week)
I've created yet another WPF theme (with the help of Claude)
Acrylic, Accented, with lots of controls to choose from.
- Automatic transparancy when using the program via RDP for better performance.
- Can pickup system accent for personalized theming.
- Comes with virtualized datagrid, search combobox and more.
https://montago.github.io/NocturneTheme/
https://github.com/Montago/NocturneTheme
https://www.nuget.org/packages/Nocturne.Wpf/
Feedback is appreciated.
r/dotnet • u/Matronix • 1d ago
Using a Lenovo Thinkpad P1 for work .NET development and really like it. Want to work on some personal projects so going to get me a laptop to do that work. Was looking at sales and the Yoga Pro 7i stands out. Anyone have any reservations against that laptop?
The problem I wanted to fix: integration tests against SQL Server either run on a tiny seed that looks nothing like production, or on a shared database everyone keeps breaking. Restoring a real backup per test run is way too slow once it's tens of GB.
So I built SqlBranch. You restore a backup once into an "image" (and run your masking scripts on it), then every test, PR or dev gets a writable branch of it in a couple of seconds. Branches are copy-on-write clones of the database files (XFS reflink), so they share blocks with the image and only copy what you change. On a 50 GB database, the clone takes about 0.4 s and a new branch is ~300 KB on disk. It never touches your production server, just a backup file.
From a test it's one line:
await using var db = await SqlBranchDatabase.CreateAsync("shop");
// db.ConnectionString -> your own copy, dropped when the test endsWorks with xUnit, NUnit and MSTest (SqlBranch.Testing on NuGet). The CLI is a dotnet tool:
dotnet tool install --global SqlBranch
sqlbranch init
sqlbranch image build shop --from-bak ./shop.bak --post-script mask.sql
sqlbranch branch create my-feature --from shop"Why not Testcontainers?" I got this a lot already. If an empty DB + EF migrations + a small seed is enough, Testcontainers is great and you don't need this. SqlBranch is for when you want real data volume: catching a migration that breaks on old NULLs or duplicates, or a query that's fine on 20 rows and slow on 20 million.
Some honest limits: it's dev/test only (SQL Server Developer edition in Docker). Linux and macOS work, Windows isn't tested yet. In CI you need a runner where the image lives, since rebuilding it every job would defeat the point.
Open source, Apache-2.0: https://github.com/vuglll/SqlBranch
Curious what you think, especially what would stop you from using it.
r/dotnet • u/GayaniTupai75 • 2d ago
We moved ~30 services to . NET 10 when 8 went out of support and flipped NuGet audit warnings to errors while were at it. When we decide a CVE doesn't affect us, we add a suppression in Directory.Build.props with a comment and a date as it again
<!-- not reachable per SCA trial, recheck 2027-02 -->
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-xxxx-xxxx-xxxx" />We're also trialing an SCA tool with reachability and it marks most of our open advisories as not reachable. Before trusting that, I pulled 25 of the not reachable ones and went through them with a colleague. 22 looked right, 2 we couldn't tell either way and 1 was flat out wrong.
The wrong one is a serializer inside a plugin assembly we load by type name from appsettings with Activator.CreateInstance. Nothing in our code calls it directly which am guessing is why the tool missed it. it also runs the service that makes file uploads, which is great.
Kind of feels like the other 22 are only right because those services dont do anything clever yet.
How far do you trust a non-reachable verdict when there's DI and reflection in the mix?
r/dotnet • u/sander1095 • 1d ago
r/dotnet • u/CodeExpressAI • 1d ago
If you were building a front end host for MCP services and a chat interface to an LLM what would you use as the front end? Specifically for an internal corporate rollout
* Develop using React as a web application
* Develop using Winforms as a desktop app for windows
* Develop using MAUI so it supports both Windows and MAC clients
Just looking for some ideas.
r/dotnet • u/Proof_Cold_9268 • 1d ago
Can anyone Please suggest me learning resource for Backend Development with asp .net. please
r/dotnet • u/Glittering_Welcome73 • 3d ago
Acta is a library for durable execution in .NET.
Write durable jobs and workflows in plain C#. Completed steps and their results persist across restarts.
NuGet package + PostgreSQL, SQL Server, or SQLite. No brokers, sidecars, or separate workflow servers.
Every job is a row in your database. You can query it in SSMS or DataGrip, open the dashboard, or ask the CLI what happened to a job and what to do next.
I am committed to keeping Acta free and Apache-2.0, including future releases.
A release candidate is on NuGet. Aiming to release 1.0 by the end of the year.
Feedback welcome! I fix stuff.
Examples and documentation: https://useacta.net/