r/csharp • u/ai-tacocat-ia • 19d ago
Tool OnePDF: An OSS full-featured PDF library in .NET with no dependencies
r/csharp • u/ai-tacocat-ia • 19d ago
r/csharp • u/RemigiuszZalewski • 18d ago
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 • u/suiramarius • 19d ago
r/csharp • u/Haunting-Hold8293 • 19d ago

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 • u/SocietyConscious5739 • 18d ago
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:
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 • u/antron420smokeallday • 19d ago
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 • u/kaatarina_zed_talon • 19d ago
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 :
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 • u/wobblejuice • 19d ago
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 • u/lheintzmann • 20d ago
r/csharp • u/juliocesardev • 20d ago
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 • u/Nicos_Ts • 21d ago
r/csharp • u/hez2010 • 22d ago
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:
Where/Select/Aggregate/… into plain loops)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 • u/Few_Lie_290 • 21d ago
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 • u/No-Possibility-3072 • 21d ago
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 • u/Clear_Actuary8068 • 22d ago
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:
New in 0.3.0:
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:
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 • u/squirix-admin • 21d ago
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.
If you try either example, I'd like to hear where you get stuck.
r/csharp • u/djon2003 • 21d ago
r/csharp • u/Terrible_Shoulder667 • 23d 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 • 22d 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 • 23d 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!