r/csharp • • 19h ago

Discussion The KillerPDF engine is now MPL 2.0 instead of GPL. Is that better for you?

52 Upvotes

Recently I posted the PDF engine I built in pure C# for KillerPDF, and the main pushback was the license. GPL meant you couldn't put it in your own app unless that app was GPL too, which ruled out most real projects. You were right, I was wrong.

Since 1.9.5 the engine is licensed under the Mozilla Public License 2.0. The KillerPDF desktop app stays GPLv3, but the engine package is separate.

MPL 2.0 works file by file. You can use the engine in your own app, open or closed source, under any license you like. If you change one of the engine's own files and ship it, that file's source has to stay open under MPL 2.0. Your code around it stays yours. I'm trying to encourage better developers than myself to help me make the engine better for everybody.

As part of this, I had to swap out the JPEG 2000 decoder, and the engine now uses OpenJPEG instead of CoreJ2K. That turned out to be a blessing in disguise, because OpenJPEG appears to be more color accurate on the files I've thrown at it. The native decoder ships in the NuGet package for Windows x64, Linux x64 and macOS.

Here's how it compares to PDFsharp/PDFium:

  • Rendering. PDFsharp doesn’t render existing PDF pages. Its FAQ points to a Ghostscript sample for generating page images. PDFium renders through a native library. KillerPdf.Engine renders pages in managed C# without PDFium.
  • Licensing. Starting with 6.5.0, PDFsharp requires applications to initialize either the AGPL license or a paid commercial license. KillerPdf.Engine is MPL 2.0 and can be used in closed-source apps without a license fee, subject to the MPL’s notice and source-sharing requirements.
  • Text. PDFsharp exposes characters in drawing order through low-level APIs, with no built-in word or paragraph grouping. PDFium can extract text and character bounds. KillerPDF previously used PdfPig for extraction. KillerPdf.Engine returns words, lines, and letters with their page coordinates.
  • Editing. PDFsharp offers low-level content-stream editing, and PDFium can replace text in individual text objects. KillerPdf.Engine provides APIs for editing lines and paragraphs on existing PDF pages.
  • Stability. PDFium requires callers to serialize its API calls. KillerPDF 1.6.3 hit a native heap corruption crash when two threads entered PDFium at once. KillerPdf.Engine uses a managed C# page renderer.
  • Signatures. PDFsharp documents how to sign and timestamp PDFs. KillerPdf.Engine also verifies existing signatures and supports certificate trust, timestamp, and revocation checks.
  • Redaction and OCR. PDFsharp’s docs don’t list built-in permanent redaction or OCR. KillerPdf.Engine removes targeted content and reopens the output to check for remnants. The engine can run OCR without Tesseract. The KillerPDF desktop app keeps Tesseract as a fallback.
  • Standards. PDFsharp can write PDF 2.0 and offers limited PDF/A support. KillerPdf.Engine writes PDF 2.0 and provides dedicated authoring modes for PDF/A-4, PDF/A-4e, PDF/A-4f, and PDF/UA-2.

It's on NuGet as KillerPdf.Engine. Docs are at https://killerpdf.net/engine.html and the source is at https://github.com/SteveTheKiller/KillerPDF/tree/main/engine .

So, does MPL actually fix it for you, or is there still something that keeps you from using it? If you'd need something like MIT or Apache to ship it, I'd like to hear why. I'm not fully against moving in that direction.


r/csharp • • 2h ago

Help Hi! Minor homework help? Using if-then w/ checkboxes & labels

1 Upvotes

The issue I'm having is mostly getting the label to update. I'm assuming it's just due to my own stupidity that I don't see the problem, but a lot of the code is based on the book i'm issued so that's why i'm a bit stuck.

I think I did most parts of the assignment, however I'm having trouble figuring out labels still lol. I'm not asking for the answer but it'd be nice to know wtf is wrong with it

I've tried reformatting the if-then a bit (hence in this example i've showed it might not look exactly right, i've tried literally everything i could). i've never used nested if-then before, and I'm not getting any error messages so it's hard for me to pinpoint the issue. i've also tried playing around with the lbl name and the positioning

i'm a total newb so some pointers would be appreciated.

the goal is to calculate a total price based on:

product quantity (textbox); product (combo box); & membership status (checkbox), then to have the final output in a label box


r/csharp • • 22h ago

Showcase AnyCLI - an AoT-friendly library for building modern CLI apps in C#/.NET

Thumbnail
drmathias.github.io
32 Upvotes

Hi, I've been working on a side project building a CLI application in C# for a few months and during that time tried out various libraries for building CLIs. None of them really fit my needs. I tried contributing to improve them, but in the end decided a whole new approach was needed.

Thus I've created AnyCLI. The philosophy is to optimise for utility and extensibility, while maintaining high-performance and provide sane defaults. Key features include:

  • AOT-compatible command registration and execution
  • Source-generated parameter binding with no runtime reflection
  • Typed positional arguments and named options
  • Required, optional, variadic, collection, and defaulted parameters
  • Nested command groups
  • Custom value parsers
  • Dependency injection support
  • Typed enum exit codes
  • Typed global options
  • Interceptor middleware
  • Cancellation support for async commands and interceptors
  • Fully customisable help and error handling
  • Built in internationalisation - localized error messages and help for English, French, German, Spanish, Brazilian Portuguese, Italian, and Dutch
  • Configurable localization
  • Optional Spectre.Console adapter for rich, styled terminal output and error messages (tables, markup, progress bars etc.)
Feature showcase - localization and rich-rendering with Spectre.Console integration

Benchmarks are solid, beating System.CommandLine and Spectre.Console.Cli in both performance and cold-start time. Though nothing can top performance of ConsoleAppFramework - a testament to the great abilities of the maintainers.

AnyCLI Benchmarks

I'd love for you to try it out and share your feedback. The docs are still a WIP and a stable v1.0.0 is close.


r/csharp • • 13h ago

Help Alguien me puede recomendar cursos de YouTube para aprender asp.net ?

0 Upvotes

He buscado en Youtube y los que me salen son desactualizados,de hace 7 o 8 años,o menos,pero como .net suele actualizar rápido las tecnologías que usa,como es el caso de la cantidad de frameworks para GUI que tiene,no sé si me sirvan esos cursos,lo otro es que los que he visto son de mvc,o sea para renderizar web,y lo que busco en rest con manejo de token ,oauth ect,vengo de java,estoy aprendiendo c# ahora pero estoy buscando los cursos de asp con antelación para poder verlos una vez entienda las bases de c#,pienso aprender asp.net luego de saber las bases del lenguaje,ado.net y entity framework core


r/csharp • • 1d ago

.NET 10 control plane with EF Core and PostgreSQL, looking for contributors to implement an OpenAPI draft

Thumbnail
reddit.com
0 Upvotes

r/csharp • • 1d ago

I created a Source Generator for creating Non-Boxing Unions in .NET 11

Thumbnail
reddit.com
4 Upvotes

r/csharp • • 2d ago

I implemented LINQ in my own programming language!

Post image
109 Upvotes

I've been working on my own scripting language for my game engine, whose interpreter I wrote in C#. So, for quite a long time now, the only languages I use are C# and my custom language.

Apparently, Earth is a really dark and sad place without LINQ, so I decided to add it to my language!

My language's LINQ library source code

I did my best to make the design as close to .NET LINQ as possible. You can query anything that you can use in a foreach loop, and it uses deferred execution, meaning the query doesn't actually run until you iterate over it or call .toArr(), .toList(), or one of the other methods that execute it.

It also performs just one iteration per query. You can do where().select(), and instead of iterating once for the where operator and then again for the select operator, it processes both in a single iteration.

I had to figure out how to achieve this in a language that doesn't have the yield return keyword. I know theoretically what yield return does, but actually figuring out how to get the same result without using it was quite challenging...

Anyway, you can see a few examples of queries written in my language in the screenshot.

The syntax isn't as clean as C#'s, but it's good enough for me!

Here's another little example:

class User (name, password) { constructor(...); }

const users =
[
    new User("Peter", "messithegoat"),
    new User("Donald", "london101"),
    new User("Joe", "banana1234"),
    new User("Ben", "chocolate2")
]

foreach user in q(users).orderBy(func(u) => u.name, StringComparer.ordinalIgnoreCase)
{
    println(user.name)
}

// Output:
> Ben
> Donald
> Joe
> Peter

And here you can see the full code of the LINQ library written in my language. It's still missing some of the operators, but I've opened an issue in the repo for implementing the rest, so feel free to give it a try!

I've already had some contributions to other parts of the engine from people who thought the project was cool.


r/csharp • • 2d ago

Got Microsoft.UI.Reactor to run cross-platform!

Post image
127 Upvotes

Microsoft.UI.Reactor's brings declarative C#-based UI to Windows. But what if it could run everywhere else too?

I took the Microsoft.UI.Reactor open-source repository, forked it, and switched it to compile against Uno Platform's open-source NuGet packages, and voilà! Now the exact same same Reactor code runs on all devices and platforms: Android, iOS, WebAssembly, Linux, macOS, and even tvOS!

The fork's CI now publishes ready-to-use packages on NuGet, targeting the newly released Uno Platform 7.0. Reactor components are composed from WinUI controls, so in case of Uno Platform the same controls render on all targets via SkiaSharp 4/WebGPU, with .NET 11 support, and they can coexist with existing XAML pages, styles, and view models.

If you want to try it out (or even contribute too 😉!), here is the repository https://github.com/unoplatform/Uno.microsoft-ui-reactor/ and the docs
https://platform.uno/docs/articles/features/using-reactor.html

Would love to hear your feedback if you take it out for a spin! It is pretty exciting, as it took just a few code changes to get it up and running 🚀


r/csharp • • 2d ago

Blog Top .NET 11 RPC libraries vs 26 gRPC libraries from an updated grpc_bench (Rust, Go, Java, C++)

Thumbnail
fusion.actuallab.net
13 Upvotes

Disclaimer: I am the author of ActualLab.Rpc and its RpcBenchmark, so I am not a neutral party. But the code is open source, and I welcome you to read it, run it, or evaluate with your AI agent.

I did my best to make the comparison fair - you can read about this in "Important Remarks" section.


r/csharp • • 1d ago

How would I get randomiser to stop giving duplicate questions?

Thumbnail reddit.com
0 Upvotes

r/csharp • • 2d ago

I built AiDotNet to show the world that it is possible for .NET to do AI better than Pytorch

Thumbnail reddit.com
0 Upvotes

r/csharp • • 3d ago

Tutorial nanoql: stateless quant finance in C#: immutable values, static pricers, .NET 10

20 Upvotes

nanoql is an open-source pricing library for .NET 10: curves, swaps, swaptions, SABR, equity options, Heston, CDS. Instruments, curves and models are immutable values, and pricers are static functions of them; the evaluation date is an argument, not a global setting.

var today = new Date(15, Month.October, 2026);
var context = new EvaluationContext { EvaluationDate = today };
var curve = new FlatForward(today, 0.036, new Actual365Fixed());

var swap = new MakeOIS(new Period(5, TimeUnit.Years), new Sofr(curve))
    .WithFixedRate(0.036).WithNominal(10e6)
    .ToOvernightIndexedSwap(context);

var result = DiscountingSwapEngine.Calculate(swap, context, curve);
Console.WriteLine($"NPV {result.NPV:N2}, fair rate {result.FairRate:P4}");
// NPV 7,041.24, fair rate 3.6154%

Some .NET details that may interest you:

  • It uses static abstract interface members, so it needs .NET 10 and has no .NET Framework build.
  • Python, C and C++ reach it through Native AOT: one C interface over the compiled library, so pip install nanoql needs no .NET runtime.
  • The Excel add-in is generated from the same surface with Excel-DNA.
  • It's derived from QuantLib 1.44 and checked against it: 3.35 million reference outputs, 99.86% within a relative 1e-10, and QuantLib's own tests ported at their tolerances.

dotnet add package NanoQL · getting started · GitHub · Apache-2.0


r/csharp • • 3d ago

Discussion Windows & Linux file access

1 Upvotes

Muti tenant self-hosted where each tenant has workspace directory at app level we resolve via

Path.GetFullPath(Path.Combine(tenantRoot, userPath))`, then require `resolved == tenantRoot || resolved.StartsWith(tenantRoot + Path.DirectorySeparatorChar)

os.path.realpath is cannoned for unresolved realpath. Wanted to know is `GetFullPath along with prefix-with-separator is enough? Does realpath needs O_NOFOLLOW`-style flags?

We volume-mount workspaces into containers is that ok or there should be OS level or app level canon? How to regress test in CI is there any fuzz list?


r/csharp • • 3d ago

Discussion is C# a good language to use for making a game engine?

54 Upvotes

so I have a from what i find a intermediate amount of knowledge on C# and have made some games in unity. now i want start a big project that could really make me a better programmer and after some researching i would like to maybe start making my own game engine. would this be a good idea? or is there another big project that maybe could be better suited? i know it could take longer than a year to build and that i need to learn a lot about low level programing but i think it could be really fun. or should i do the project in C++?


r/csharp • • 3d ago

[Show & Tell] eQuantic.UI: Write UI components once in C# and compile to vanilla JS (no WASM) on the web or native GPU pixels via Metal/Vulkan (no WebView/Skia)

0 Upvotes

Hey r/csharp,

I have been working on an open-source UI SDK called eQuantic.UI, and I wanted to share the architecture and get some feedback from the community.

The goal is simple: write UI components once in C# using a strongly-typed declarative vocabulary (Box, Row, Column, Text, etc.) and let the SDK compile each target to its real native path, without relying on JavaScript, CSS, Dart, Swift, or platform manifest files.

How it works under the hood:

  • Web (No WASM): At build time, the compiler uses Roslyn to transpile your C# components into optimized vanilla JavaScript and atomic CSS. It supports server-side rendering (SSR) with client hydration and built-in RPC calls via [ServerAction], avoiding the heavy .NET WASM runtime download.
  • Desktop & Mobile (No WebView, No Skia): On macOS, iOS, Android, and Windows, the same component tree renders directly on the GPU through Photon (a custom rendering engine built on Metal and Vulkan).
  • Transactional Email: The subset of components an email client supports compiles into email-safe HTML tables with inline styles, along with a plain-text version from the exact same tree.
  • Zero Node.js friction: You only need the .NET 10 SDK installed. The TypeScript/bundling toolchain ships embedded inside the NuGet SDK package, so there is no npm install, no webpack/vite config, and no manual Info.plist or AndroidManifest.xml setup.

Quick Start:

Bash

dotnet new install eQuantic.UI.Templates
dotnet new equantic-app -n MyApp
cd MyApp && dotnet run

(You can also use dotnet new equantic-native to spin up a native GPU window.)

The project is licensed under MIT and is currently in active preview (0.2.0-preview.* on NuGet). I would love to hear your thoughts on the approach, API design, or any edge cases you see with AST-to-JS transpilation and custom GPU rendering.

GitHub repository (with architecture docs and samples):https://github.com/eQuantic/equantic-ui


r/csharp • • 4d ago

Showcase EF Core Query Plans in VS Code: EFCore Visualizer 1.0

Thumbnail
giorgi.dev
21 Upvotes

r/csharp • • 4d ago

Showcase I benchmarked my C# Binance client against the two main Rust clients. C# won by up to 33x

167 Upvotes

I've done .NET for 25+ years, mostly low-latency stuff, and I got tired of hearing that Rust is just faster by default. So I built a Binance client on .NET 10 and put it up against the official Binance Rust SDK and NautilusTrader's Rust adapter.

Whole clients, through their public APIs. Same recorded mainnet traffic, same machine. An old i7 from 2014, so nothing hides behind fast hardware.

Against the official Rust SDK:

  • 33x faster per message
  • up to 17x faster throughput on one connection
  • 43x better p99.9 latency at live market pace
  • 1,500 candles over REST: 12.8x faster, and 3 KB of memory against almost 4 MB

The funny part: even Binance.Net, which builds an object for every message, beats both Rust clients on speed per message and on throughput.

So where does Rust lose? The official SDK makes 69 heap allocations for one book ticker message. No GC, sure, but every malloc and free still costs time.

What I did in C#:

  • UTF-8 goes straight into flat structs. No strings, no JSON tree
  • Handlers are generic structs, so the JIT builds a separate copy for each one and inlines your callback. Same idea Rust calls monomorphization
  • Parsers are static abstract members, so there are no parser objects at all
  • Zero allocations per message, the GC never runs
  • Native AOT, and any reflection fails the build

The method and every table are in the repo (ADR-0018), plus a recorder so you can run it all on your own data.

https://github.com/Axitor/Trading.Gateway

Ask me anything, or roast the benchmark setup, I'm here for both. And if you think C# deserves more credit for speed, a star on the repo really helps ⭐


r/csharp • • 4d ago

Best approach for centralized DateTime handling in ASP.NET MVC 5?

12 Upvotes

I'm working on an existing application built with ASP.NET MVC 5, Entity Framework 6, SQL Server, and DevExpress/DevExtreme components. We want to implement a centralized approach for storing all dates in UTC and converting them to the appropriate local timezone for display, while also handling date filters and existing database records correctly. Since the application has multiple controllers, services, and grids, we'd like to avoid repeating conversion logic throughout the codebase. What architecture or best practices would you recommend for implementing this consistently, safely, and with minimal changes to the existing application?


r/csharp • • 4d ago

Showcase I'm building my own video and music player based on libmpv2 with Avalonia UI (Linux only)

Thumbnail
gallery
7 Upvotes

I'm working on MediaPlayer (mp), which is written in C#. It uses P/Invoke to communicate with libmpv2, manual GLX rendering to display the video, D-Bus for MPRIS2, and Avalonia UI for the interface. The player is useful for listening to music, watching videos, and more. You can have a playlist, and the last state is saved for the next time you open it. It's still in development, but it's stable enough for everyday use.

I'd like to receive feedback to improve the app, and to fix any issues, with the goal of eventually becoming a good alternative to Celluloid or Cine.

The source code and installation are here: https://github.com/1R1an1/MediaPlayer


r/csharp • • 4d ago

I built my portfolio as a 3D game in Blazor WebAssembly (Three.js for rendering, all game logic in C#)

Thumbnail
reddit.com
1 Upvotes

r/csharp • • 5d ago

How are you handling countries, currencies, and cities data in your apps?

12 Upvotes

I'm building a multi-tenant SaaS in .NET (Blazor, EF Core, PostgreSQL) that will be used globally, and I need a reliable source for countries, their currencies, and cities worldwide.

I haven't found a single NuGet package that covers all three. RegionInfo, Nager.Country, and NMoneys handle countries and currencies well, but cities seem to be the hard part.

How are you handling this in your projects?

Do you seed your own tables from a dataset (GeoNames, dr5hn, something else), or call an external API?

If you seed, how many cities do you keep, and how do you handle cities that are missing or added by users?

Any problems with performance, licensing, or keeping the data up to date?

Interested in hearing what has worked (or hasn't) for you, whatever your stack. Thanks!


r/csharp • • 4d ago

I built an offline-first Android vault app that looks like a calculator (AES-256-GCM, Argon2id)

0 Upvotes

I built an offline-first Android vault app that looks like a calculator (AES-256-GCM, Argon2id)

Hallo zusammen,

Als Entwickler, der sich stark auf absolute Datenschutz und Null-Cloud-Abhängigkeit konzentriert, hatte ich genug von Cloud-synchronisierten Passwort- und Tresor-Apps, die Telemetrie lecken oder Backend-Server benötigen. Also habe ich meine eigene entwickelt.

Ich präsentiere Kryptex – ein Offline-First-Android-Tresor für sichere Dateien und ein Steganografie-Tool.

Kern-Technologie-Stack & Funktionen:

\* Null Telemetrie / 100% Offline: Keine Cloud-Synchronisierung, keine Konten, keine Serververbindungen. Deine Daten bleiben ausschließlich auf deinem Gerät.

\* Starke Kryptografie: Nutzt AES-256-GCM-Verschlüsselung in Verbindung mit Argon2id-Schlüsselableitung, um Widerstandsfähigkeit gegen Brute-Force-Angriffe zu gewährleisten.

Steganografischer Tresor & Tarnung

Im Gegensatz zu Tresor-Apps, die sich als Taschenrechner oder andere Werkzeuge tarnen, setzt Kryptex auf reine Steganografie: Verschlüsselte Nutzdaten werden direkt in Standard-Bilddateien (PNG/JPEG) eingebettet. Die verschlüsselten Daten bleiben im normalen Bild absolut unsichtbar, sodass du deine Tresor-Dateien direkt in deinen normalen Fotoordnern speichern kannst, ohne Aufmerksamkeit zu erregen.

\* Lokale Kontrolle: Du besitzt deine Schlüssel und deine Dateien.

Ich habe dies hauptsächlich entwickelt, um ein Werkzeug zu haben, dem ich auf meinen eigenen Geräten bedingungslos vertrauen kann. Ich würde mich über Feedback von sicherheits- und datenschutzbewussten Leuten hier zur Architektur oder zu Funktionen freuen, die ihr von einem rein lokalen Tresor erwarten würdet.

Ich beantworte gerne alle technischen Fragen in den Kommentaren!


r/csharp • • 5d ago

Blog Build only what changed in your .NET monorepo with dotnet-affected

Thumbnail
stenbrinke.nl
44 Upvotes