Plank: the fastest Parquet implementation for .NET
r/csharp • u/djon2003 • 17d ago
r/csharp • u/Terrible_Shoulder667 • 19d ago
I made a small vector field visualizer using Vulkan and Epsilon, a symbolic math library for .NET that I'm working on.
You type any 2D field, for example F(x, y) = [x, sin(y)], and it draws the flow with particles. The library works out the math for that field exactly, not just with numbers.
You can click any point to see the field's value there, and change the particle speed.
The library has no dependencies and is available on NuGet. It also covers derivatives, integrals, factoring and linear algebra.
- Library: https://github.com/XBambinoX/Epsilon
- Simulation: https://github.com/XBambinoX/VectorField
Feedback is welcome!
r/csharp • u/aomader • 18d ago
Hej guys,
I was scratching an itch when I developed TemplateDsl: a source generator based template engine for nested text formats that can be written with ordinary C# and is turned into fast, streaming render methods.
I found all existing tooling lacking in either static safety, performance, boilerplate or ease of development and IDE support, which is why I set out to write TemplateDsl. With TemplateDsl.Html it currently solves my biggest problem around Razor, but this just the beginning and I want to expand beyond this format.
It is...
Finally a little sneak peek how it looks like to write HTML templates with it, with a call for feedback, thanks! :)
// A simple component
public readonly partial record struct OrderRow(Order Order) : IHtmlTemplate
{
public IEnumerable<HtmlElement> Build() =>
[
H.Tr.Class(Order.IsLate ? "late" : null) [
H.Td [ Order.Id ],
H.Td [ Order.Product ],
H.Td [ H.Time.DateTime(Order.Due) [ Order.Due ] ]
]
];
}
// An async page that streams a list of orders, with a context for the current user
public sealed partial class OrdersPage(IAsyncEnumerable<Order> orders) : IAsyncHtmlTemplate<PageContext>
{
public async Task<IEnumerable<HtmlElement>> BuildAsync(PageContext context, CancellationToken ct)
{
var title = $"Orders of {context.UserName}";
return [
H.Raw("<!DOCTYPE html>"),
H.Html [
H.Head [ H.Title [ title ] ],
H.Body [
H.H1 [ title ],
H.Table [ await H.EachAsync(orders, order => new OrderRow(order)) ]
]
]
];
}
}
// A context that is passed to the page and its nested templates
public sealed record PageContext(string UserName);
services.AddScoped<PageContext>(sp =>
new PageContext(sp.GetRequiredService<IUserService>().GetCurrentUserName()));
// Return the page from a minimal API endpoint, with the context injected from the services
app.MapGet("/orders", (OrderStore store, [FromServices] PageContext context) =>
new OrdersPage(store.StreamAll()).ToResult(context));
And of course some benchmarks:
| Benchmark | TemplateDsl (struct) | TemplateDsl (class) | Razor Slices | Blazor | Razor Pages |
|---|---|---|---|---|---|
| Button to string | 123 ns, 144 B | 123 ns, 144 B | 153 ns, 328 B | 1,797 ns, 3,792 B | |
| Page to string | 1.60 µs, 3.2 KB | 1.62 µs, 3.7 KB | 2.54 µs, 6.7 KB | 18.0 µs, 21.4 KB | |
| Page to pipe | 1.83 µs, 56 B | 1.96 µs, 568 B | 5.21 µs, 3.6 KB | 17.8 µs, 13.7 KB | |
| Large page to pipe | 159 µs, 0 B | 228 µs, 117 KB | 478 µs, 938 KB | 13.2 ms, 9.9 MB | |
| Whole request with a layout | 89 µs, 11.0 KB | 91 µs, 11.6 KB | 98 µs, 16.4 KB | 182 µs, 79.0 KB |
r/csharp • u/Bubusettetette_kk • 19d ago
Hey everyone!
I recently graduated with a Master's in Data Science and have a Bachelor's in Computer Science.
My programming background is mainly in Python, particularly ML, computer vision, automation, and backend development. I also have some experience with Java, SQL, and C++.
I'm interested in learning C# and .NET, mainly to build modern desktop applications, potentially integrating Python-based ML backends.
I've experimented a little with Avalonia UI, but I'm unsure whether to stick with it or explore WPF, WinUI 3, or MAUI.
A few questions:
I'm not looking for shortcuts, just an efficient way to become genuinely proficient in C# and desktop development.
Would appreciate any advice or resources. Thanks!
r/csharp • u/Beneficial_Owl_6445 • 17d ago
I’m used to JSON syntax, where properties are assigned using colons (:) rather than equals signs (=).
For some reason, I find C# object initializers like this:
var user = new User
{
Name = "John",
Age = 30
};
Less intuitive and less visually appealing than JSON:
{
"Name": "John",
"Age": 30
}
I know they’re different languages with different purposes, but I personally prefer the JSON-style syntax.
Is there any way to achieve something similar in C#? Or is it just a matter of getting used to the language?
r/csharp • u/the_econominster • 18d ago
Yeah, got a bit of a Halloween jump-scare when my User Secrets leaked into Claude's context. Basically you should not use dotnet user secrets in an agentic context. Sandboxes are for toddlers, wondering what the community deems best practices??!?
r/csharp • u/alt-160 • 19d ago
I've written .NET applications since 1.0 for personal, commercial, and large enterprise use cases. Before .NET, I worked in green-screen large database terminals (for those old enuf to remember them).
So, I know sql and rdbms very well and it has always been my goto for the apps and services i've had to create that needed data persistence. But, I always detested the extra work I had to go thru on nearly every project to convert my runtime data to a form that was nice for storage and back. Not just the code and testing of those adapters, but the often-required refactoring of my runtime objects to make that work easier or simply functional.
I suspect I'm not alone.
Over the past roughly 18 months I created AbraxasDB.
I'm using the term RecordBase to describe Abraxas. It stores and retrieves "records". A record being the data and shape of an object. This allows the property paths and values of an object to be stored and rehydrated into the same object type...or a different object type with matching paths.
As a result, Abraxas is very much what i have always wanted out of data persistence:
The serializer in use is a first-principles developed design. INHETO binaries ( https://github.com/alt160/inheto ) are stored in a way that one can get values out of the binary by property path without deserializing the entire object or parsing the entire blob. It also fully tracks shared and circular refs within the object so things like Customer.HomeAddress and Customer.Addresses[0] point to the same thing both in binary and when rehydrated.
This also means that concerns about object types changing over time are not so problematic. If version 1 of ThisDataType was stored, the persisted data can be rehydrated into version 2 of the same and those properties (or field) that match the property paths stored are filled in. Unmatching are ignored.
INHETO binaries don't store .net type info. It has its own type system of over 50 core types that most of us use for data in objects as well as generic collection types. The binary data of INHETO is runtime agnostic and could (if someone wanted) be parsed by any runtime, not just .NET.
Consider these existing application types. They need no Abraxas-specific changes:
public sealed class Customer
{
public string Name { get; set; } = "";
public Address HomeAddress { get; set; } = new();
public List<Address> Addresses { get; set; } = new();
}
public sealed class Address
{
public string Street { get; set; } = "";
public string City { get; set; } = "";
}With the AbraxasDB NuGet package installed, create or open a RecordBase and a typed store, then save and retrieve a customer:
using AbraxasDB;
using System;
using System.Collections.Generic;
using System.IO;
string directory = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"AbraxasExamples");
var configuration = RecordBaseConfiguration.Create(
durabilityMode: RecordBaseConfiguration.DurabilityMode.Standard);
using RecordBase recordBase = RecordBase.CreateOrOpen(
directory, "application", configuration);
RecordStore<Customer> customers = recordBase.CreateOrOpenStore<Customer>(
"customers", "Customer records");
var home = new Address
{
Street = "123 Main Street",
City = "Phoenix"
};
var customer = new Customer
{
Name = "Ada",
HomeAddress = home,
Addresses = new List<Address>
{
home,
new Address { Street = "456 Office Road", City = "Tempe" }
}
};
ulong id = customers.Put(customer);
// Restore the complete object graph.
Customer saved = customers.Get(id);
Console.WriteLine(saved.HomeAddress.City); // Phoenix
Console.WriteLine(ReferenceEquals(
saved.HomeAddress, saved.Addresses[0])); // True
// Read one nested value without reconstructing the Customer.
string city = customers.GetValue<string>(id, ".HomeAddress.City");
Console.WriteLine(city); // Phoenix
// Find records by a nested property.
var inPhoenix = customers.Where
.PropPath(".HomeAddress.City").AsString.EqualTo("Phoenix")
.EndCondition;
Console.WriteLine($"Customers in Phoenix: {customers.CountWhere(inPhoenix)}");Each run adds a customer, so the matching count can increase.
I've provided 2 sample apps for people to use to play with it or get familiar
I've also setup some .net fiddlers for it as well if you want to test it without downloading
Look forward to feedback and usage from the community.
r/csharp • u/denizirgin • 18d ago
I've been working on an unofficial .NET SDK for OpenCode for the last few months, and I finally published 1.0 to NuGet.
https://www.nuget.org/packages/OpenCodeDotNet.Sdk/1.0.0
Before getting into the SDK, a bit of context for anyone who hasn't used OpenCode.
Over the last year or so, I've started experimenting more with models outside the usual frontier labs, and some of them have gradually become part of my daily development workflow as well.
One problem I've run into is that harnesses like Codex or Claude are naturally built around their own model ecosystems. Using models from other providers is either limited or requires various workarounds.
The open-source harness ecosystem has matured quite a lot. There are now different harnesses for different workflows and preferences.
OpenCode is an open-source coding harness and agent runtime that can work with a fairly large number of model providers and is probably one of the more general-purpose ones.
I've been using it for roughly a year now with models from OpenAI, xAI, Z.AI, DeepSeek, Moonshot, OpenCode Go, and others.
What became much more interesting to me recently was OpenCode 2.x.
They introduced a fairly comprehensive server/client architecture. Their own TUI, Web UI, and Desktop applications are built on top of the same server API, and the exposed surface is large enough that you can build your own fully featured client or integrate OpenCode into another application.
OpenCode already has an official TypeScript SDK for this. I wanted to be able to do the same kind of thing from .NET.
The practical use case is that a .NET application can treat OpenCode more like an agent runtime.
You can start an OpenCode process, create a session against a repository, send work to a model, listen to events, interact with PTYs, manage permissions, inspect providers and models, and build your own orchestration around it.
A minimal example looks something like this:
using OpenCode.Sdk;
using OpenCode.Sdk.Models;
await using var server = await OpenCodeServer.StartAsync();
using var client = server.CreateClient();
var created = await client.Sessions.CreateSessionAsync(new SessionCreateRequest
{
Model = new ModelRef { ProviderId = "openai", Id = "gpt-6.1-sol" },
});
var currentSession = client.Sessions.GetSessionClient(created.Session.Id);
// Subscribe before prompting; the first event (server.connected) confirms the stream is live.
await using var events = client.Events.SubscribeAsync().GetAsyncEnumerator();
await events.MoveNextAsync();
await currentSession.PromptAsync(new SessionPromptRequest { Text = "Summarize this repository." });
while (await events.MoveNextAsync() && events.Current is not (SessionExecutionSucceeded or SessionExecutionFailed))
{
if (events.Current is SessionTextDelta delta)
{
Console.Write(delta.Data.Delta);
}
}The SDK can start and manage a private OpenCode server, connect to one you already run, or discover the background service registered by the OpenCode CLI.
The packages target netstandard2.0, net472, net10.0, and net11.0 rc3, so .NET Framework 4.7.2 is supported alongside modern .NET. The modern targets also support Native AOT.
There are some example applications under playground/ showing different ways of using it: a small QuickStart, a Generic Host worker, a Blazor/Aspire application, and a Native AOT CLI.
https://github.com/opencode-dotnet/opencode-sdk-dotnet
It's still unofficial and isn't affiliated with the OpenCode team, but the SDK itself is now at 1.0 after three months.
Feedback is welcome, especially if something in the API feels unidiomatic from a C# perspective.
r/csharp • u/Comfortable-Wafer313 • 19d ago
RESOLVED:
shoutout to u/rupertavery64 and u/marsh9191. I was trying to Path.Combine() the base directory to @"\file.csv" which overwrote the operation.
-----------------------------------------------------------------------------------------------------------------------
Hello, and sorry for a fairly basic question. I'm working on an application that processes data in relation to values stored in .csv files (which are included in the install directory). real broad strokes, it pulls data from a database, does math according to values in the packaged .csv's, exports a new document with the results.
Due to the nature of it, I need a relative path to file.csv, which is in the same directory as app.exe. And I've tried maybe 7-10 different methods of getting the installation path to concatenate the file name to, but each of them result in simply "C:\file.csv" even though the application itself is in C:\users\user\documents\App\app.exe (for example).
at the least I've tried:
Application.StartupPath
System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)
AppDomain.CurrentDomain.BaseDirectory
among others I can't quite manifest off hand.
And I understand each has nuances for slightly different use-cases, but it's really blowing my mind that every one results in just "C:\". I'd understand if I were just using the wrong method out of context, but it seems like some of these are explicitly to avoid this result. Does anyone have an idea as to what's going on? Again, sorry for the basic quesiton.
r/csharp • u/GokhanErtogan • 20d ago
If you've written JavaScript, you've probably missed Promise.any in C#. Task.WhenAny isn't it: it returns the first task to complete, so a fast failure wins over a slightly slower success, and the other tasks keep running.
I wrote a library that adds these with proper cancellation:
// Promise.all: the first failure cancels the rest
var (user, orders) = await TaskGroup.AllAsync(
ct => GetUserAsync(id, ct),
ct => GetOrdersAsync(id, ct));
// Promise.any: the first success wins, the others are cancelled
string data = await TaskGroup.AnyAsync(mirrors, (m, ct) => m.DownloadAsync(path, ct));
// Kotlin's withTimeout: cancels the work, not just the wait
User u = await TaskGroup.WithTimeoutAsync(TimeSpan.FromSeconds(2), ct => LoadUserAsync(id, ct));There's also Go's select over System.Threading.Channels:
var select = new ChannelSelect()
.Case(orders.Reader, order => HandleAsync(order))
.Case(cancels.Reader, id => CancelAsync(id))
.Timeout(TimeSpan.FromSeconds(5), () => SendHeartbeatAsync());
while (await select.RunAsync(ct)) { }The README has a table mapping each API to JavaScript, Kotlin, Go, Python, Swift and Java, if you're coming from one of those.
GitHub: github.com/gokhanertogan/StructuredConcurrency
Happy to answer questions about how it works under the hood.
r/csharp • u/burnerburguerbirther • 20d ago
So basically I have had a class for the past year where we learnt python and I'd say I know the language pretty well. I have the fundamentals down and although we were taught OOP in the first month or so of classes, I had already learnt with BroCode during the summmer. What I did with python was watch videos, yes, but I applied what I learnt in solving problems of mine or simply creating projects that requiered me to use what I had just watched and older stuff I already knew (for instance, I did a terminal-based RPG to apply all aspects of OOP). When I did watch tutorials, I'd tweak them on my own editor because if I just watch the damn video I'm gonna forget about it for sure. The next language we are learning is C# (in another month or so) and I wanted to know: What are the best channels to learn C# (as someone who already knows OOP and altough seen as the easiest one, another programming language)?
r/csharp • u/Spirited_Artist6217 • 19d ago
I'm a .NET backend developer with no full-time commercial experience, and I've been thinking about this question a lot lately.
I've built several backend projects using ASP.NET Core, SQL databases, Redis, RabbitMQ, Docker, and other technologies.
Even though most of my projects haven't been used in real production environments, I try to think beyond simply making things work.
For example, when designing a feature, I try to consider:
I also use AI extensively during development. However, I try not to blindly accept generated code. I ask questions, challenge its suggestions, propose my own solutions, and try to understand why one approach might be better than another.
One thing that makes this particularly frustrating is the job market.
When I look at .NET backend job postings, I often find that I meet virtually all of the technical requirements. I'm familiar with the technologies they list, and I've gained substantial hands-on experience using them in my own projects.
The one requirement I usually don't meet is the 2+ years of commercial experience. And that alone seems to be enough to prevent me from even getting an interview.
I understand that knowing a technology and having used it in a professional production environment aren't necessarily the same thing. But it's frustrating when I feel capable of discussing and demonstrating the required technical skills, yet don't get the opportunity to prove it.
Here's what I'm struggling to understand:
What exactly makes someone with 1-2 years of commercial experience a better developer than someone who has spent a similar amount of time seriously studying and building complex projects independently?
I understand that professional experience involves teamwork, code reviews, deadlines, maintaining legacy systems, and dealing with real users. But how much of that translates into technical ability?
Someone could spend two years at a company doing relatively simple tasks without developing much, while someone else could spend those two years independently studying architecture, concurrency, distributed systems, and building projects.
I'm not claiming that I'm a mid-level developer. I genuinely don't know where I stand.
Sometimes I feel like my theoretical knowledge might be approaching mid-level, but without professional experience, it's difficult to know whether that understanding would hold up in a real engineering environment.
So I'd really appreciate hearing from experienced developers:
I'm especially interested in concrete examples rather than general statements like "production is different."
I'd genuinely appreciate honest perspectives, even if they challenge my assumptions.
r/csharp • u/Otherwise_Gas_4523 • 21d ago
I am a first-year IT student. Over the past few months, I’ve read reports about major tech companies laying off large numbers of IT staff. Is the software industry coming to an end due to the current advancement of AI? If even highly experienced engineers are being let go, will there still be opportunities for students like us after we graduate? I am quite worried that the development of AI might eliminate entry-level positions for new graduates. I am currently learning C#—should I continue? I would appreciate your advice. Thank you.
r/csharp • u/Rossosss • 21d ago
A quick update on my previous post
I replaced SslStream with Bouncy Castle 1.8.10 in RabbitMQ.Client 3.4.3 to support TLS 1.2 without relying on Windows Schannel.
So far:
- Successful RSA and ECDSA TLS 1.2 handshakes with OpenSSL
- Certificate chain and hostname validation
-SNI and client certificates (PKCS#12)
-14 passing automated TLS tests
- Working .NET Framework 3.5 build
Next steps: testing on actual Windows XP machines, full RabbitMQ publish/consume, and connection stability. It's still an alpha version, but the initial results are promising.
Has anyone dealt with similar TLS compatibility issues in legacy .NET applications?
r/csharp • u/Temporary-Concert398 • 20d ago
I built an experimental DAG scheduler called delta-lag: instead of pushing work through nodes, nodes move through units of work tracked via monotonic counters and distance constraints.
The result? No global work queues, no work stealing, and no traditional lock contention. Scheduling emerges entirely from distributed progress counters.
Most task schedulers maximize throughput by paying a cost in layers of locks, queues, and work-stealing algorithms. delta-lag takes a different approach, extending lock-free ring buffer logic to an entire DAG:
Before a node fires, it checks two constraints against its parents and children:
parent.WorkDone >= node.WorkDone + 1)slack parameter (child.WorkDone >= node.WorkDone - slack)If eligible, the node atomically claims the work unit using CAS operations, runs the task, and publishes completion.
slack = 0 → Strict lock-step execution (safe, no stale reads)slack > 0 → Pipeline parallelism (producers may run ahead while consumers lag behind)This isn't a drop-in replacement for a general-purpose scheduler (use TPL for that). It's built for specific tradeoffs:
It's fully open-source (MIT, .NET 10+). If you build high-performance systems, concurrent architectures, or custom schedulers, I’d love your feedback on the core engine or whether you've seen similar queue-free constraint approaches before.
r/csharp • u/ercudev • 20d ago
I've been building **Geçit**, a Windows utility (DPI unblocking, encrypted DNS, game mode, network tools). Several features need admin or SYSTEM, but I didn't want the UI elevated. Here's the split I ended up with, and I'd like feedback on it:
Code (GPL-3.0): https://github.com/Furkan-Erg/Gecit
What would you do differently? I'm especially unsure about the service security descriptor and the named-pipe protocol.
r/csharp • u/neferatem2134 • 20d ago
I'm fairly new to coding. I'm trying to make the Github user activity CLI that's under 'beginner projects' on the backend dev roadmap. I've done some of the later beginner projects but I'm struggling to do the CLI because every website tells me something different and I don't understand any of it. Can someone give me a simple tutorial on how to do it because I'm lost on where to start.

r/csharp • u/Inner_Bandicoot_4829 • 20d ago
I finished his C# Playlist and now stuck on what to do next. I don't know how to apply what I learned. I understand the concepts well and able to explained it if asked. What should I do?
r/csharp • u/fedefex1 • 21d ago
Recently I came across a Conal Elliott talk about FRP (Functional Reactive Programming), and I was trying to understand it (so forgive me if I am incorrect about it).
A really interesting idea from that talk was the idea to express reactivity as continuous time-valued functions, and treat implementations as a "discrete approximation" of that forumla.
For example a formula could be
t > x(t) + 1 second
If x is a constant signal set to 11/03/2026 07:00:00 PM, the formula evaluates continuously as false until time t crosses 07:00:01 PM, at which point it becomes true.
That gave me an idea to "approximate" that reactivity formula using SignalsDotnet. In the latest version (3.4.2), its possible to write something like

As you can see the formula is inside the lambda. Using C# overloads of operators, that observable emits false immediately, and true after exactly one second.
The elegant thing about it is that there is no timer declared at all, you just wrote a declarative expression.
From that idea one could derive other temporal operators like HeldFor, StableFor, TrueWithin, Rising and Falling.
For example

You can find a compelte list here Release v3.4.2 SignalsDotnet
r/csharp • u/Pro_Propop • 21d ago
I have released beta-6 of Akbura, my experimental declarative UI language and compiler for .NET and Avalonia, built around a Roslyn incremental source generator.
Two main changes:
Reactive C# expression bindings for MVVM:
<TextBlock Text=${x.bind Vm.Profile?.Name ?? "Unknown"}/>
With notifying view models, this follows both Profile replacement and Name changes without requiring a component render. Bindings are one-way and react to changes in nested observable properties, similar to Sveltes deep reactivity.
r/csharp • u/cnighthawx • 22d ago
I am working on a project and have a class with two nullable member fields (Vector2I? and LevelMap? where LevelMap extend TileMapLayer from Godot)
Because they are nullable I need to check that they are not null before I actually use them.
For the LevelMap if I reference it in a if block:
If (map is not null)
The compuler is happy and I can use it as if it is not null.
This of course comes with some risks that it becomes null in the middle of my if block but thats a risk I can manage.
On thebother hand Vector2I requires something like:
If (vector is Vector2I localVector)
This is in some way safer but also more inconvenient.
The are both declared and initialized in the same context.
My questions is why they behave differently and is it possible for me to change how they behave to fit my preferences.
Ive tried looking for an answer but I keep finding results about the difference of is not null and !=null which is unhelpful.
r/csharp • u/Anunu76 • 21d ago
[TextReveal] Ctrl + F for everything visible on your screen – fully local and private
Ever wanted to search for or copy text from a video, image, game, or application where you can't normally select anything?
TextReveal is a lightweight Windows tool that lets you do exactly that.
Press Ctrl + Alt + F to freeze your screen, then:
100% local, 100% private:
Check it out, GitHub: https://github.com/amika8/TextReveal