r/dotnet

▲ 134 r/dotnet+22 crossposts

I would like to share my latest open source local LLM inference tool implemented in C#. It supports models like Gemma4, Qwen3.6 with multi-modal (image, vision, audio), reasoning and function tool. It can run on Windows/MacOS/Linux and fully leverage GPU's capability. The API is completely compatible with OpenAI and Ollama interface.

Really appreciated if you can try it and give me some feedback. If you like it, it will be a big thank you if you can star it. Thank you very much!

u/fuzhongkai — 6 hours ago
▲ 2 r/dotnet

Devirtualize generic method calls

I have this interface:

interface IDrawable
{
    void Draw();
}

and then I have this class:

sealed class Circle : IDrawable {...}

and this:

class Canvas<T> where T : IDrawable
{
    public Canvas(T[] items)
    {
        foreach (T item in items)
        {
            item.Draw();
        }
    }
}

Now, the Circle class is sealed, so if I do:

new Canvas<Circle>(circles)

will the Draw calls be devirtualized?

If they won't, is there a way to make it, WITHOUT switching Circle from class to struct?

Thanks in advance.

reddit.com
u/Alert-Neck7679 — 7 hours ago
▲ 16 r/dotnet+1 crossposts

FluentStorage v7 released - now with Azure.Identity support

FluentStorage is a .NET library that provides a unified API for cloud storage providers. With v7, both Azure Blob Storage and Azure Files now use the same Azure.Identity authentication flow.

github.com
u/antisergio — 5 hours ago
▲ 6 r/dotnet

WinUI 3 packaged (MSIX) launch ~2× - 3x slower than unpackaged (MSI) : same AOT binary. Expected, or is there a lever I'm missing?

I ship the same WinUI 3 app (.NET 10, Native AOT, WindowsAppSDKSelfContained=true) in two ways : an unpackaged MSI and a packaged MSIX for the Store.

Every launch (cold and warm) of MSIX version is slow by 2 to 3 times. (~250ms vs ~550ms in my 6th gen i5 CPU)

I'm trying to understand whether that's just the packaged specific delay or something I can reduce.

Measured, steady-state (warm-up run discarded), same machine, same file-open argument, "Best performance" power mode, 5 runs each:

- MSI (unpackaged) - median 250 ms

- MSIX (packaged) - median 550 ms

Things I've already ruled out:

- Its a completely offline app. It reads the image file passed as argument and draws it on a Win2d Canvas surface.

- Not JIT. Both are AOT binaries.

- Not the WinAppSDK self-contained flag. (Disabling this causes an additional delay of 30 to 50ms in my PC)

- Trust level: the app is a full-trust.

- Even empty blank screen test app has the same issue.

Questions:

  1. Is a ~2× launch gap (≈300 ms) between MSIX and unpackaged normal for a full-trust AOT WinUI 3 app?

  2. Any packaged-app-specific levers I need to be aware of?

Environment: Windows 11, x64, .NET 10, WinAppSDK 2.x, AOT

reddit.com
u/ryftools — 9 hours ago
▲ 2 r/dotnet

Thoughts on UI E2E tests

After a long discussion, we decided to create UI E2E tests against our actual Dev/STG environments.

For those who targeted E2E against real environments, what are your takes? Considerations, concerns, thoughts?

reddit.com
u/Im_MrLonely — 5 hours ago
▲ 1 r/dotnet

How to Build Multiple WPF Executables into a Single Output Folder in Visual Studio?

Hello,

I have a question regarding Visual Studio. I have a solution that contains multiple WPF executable projects. Here's an example:

MyApp -> Generates MyApp.exe
MyApp.DatabaseManager -> Generates MyApp.DatabaseManager.exe
MyApp.DataAccess -> DLL
MyApp.Common -> DLL

Both executable projects reference the same two DLLs. Since they're essentially part of the same application suite, with each executable serving a different responsibility, I'd like to have them built into a single output folder, something like this:

..\Build\
    MyApp.exe
    MyApp.DatabaseManager.exe
    MyApp.DataAccess.dll
    MyApp.Common.dll

This would make it much easier to package everything into a single installer.

From what I've tried so far, Visual Studio always generates the output into separate folders, as if each executable were an independent application.

One approach I found would be to create a build script that builds both projects, copies everything into a common folder, and overwrites duplicate files when necessary. However, I'm not sure how reliable or maintainable that approach is.

Is there a way to coordinate this directly within Visual Studio, or is there a better approach that is commonly recommended?

reddit.com
u/mrcarolino — 6 hours ago
▲ 54 r/dotnet

PeachPDF -- Fully Managed HTML to PDF Conversion

PeachPDF is a pure .NET HTML -> PDF rendering library, with a recently released 0.9 release. What does pure .NET mean? This means no Chromium wrappers, no out-of-process tools, no managed libraries, and no limitations of where it will run.

tl;dr -- if you need HTML to PDF conversion, check us out at https://peachpdf.net/

If .NET 8 runs somewhere, so will this. And as a side benefit, all of the performance improvements made in .NET benefit this library immediately.

In the last year, we've made great strides with standards and features support, such as page-level header and footers use CSS Paged Media and CSS Generated Content support.

The list of what's NOT supported is probably the most relevant list:

  • SVG -- we plan on implementing it though
  • CSS Flex (coming in 0.9.1)
  • CSS Grid (coming in 0.9.2)
  • CSS Transforms (coming in 0.9.1 except for perspective)
  • CSSTransitions & Animations (its a PDF, no plans on supporting it)
  • CSS Filters & Effects
  • CSS Variables (coming in 0.9.1)
  • CSS calc() expressions (coming in 0.9.1)
  • CSS Psuedo-classes and psuedo-elements still only have partial support
  • Editable Forms
  • Tagged PDFs
  • PDF/A

The 3 main competitors to this are PuppeteerSharp, IronPDF, and PrinceXML. All have their drawbacks, mostly in terms of having to ship native code for all of them (Chromium for the first 2, Prince's native executive for PrinceXML)

PuppeteerSharp and IronPDF are pixel perfect, but... your shipping a huge browser engine. PrinceXML is a lot closer to how PeachPDF works, but its still a separate native executable.

If you've ever tried running these in Azure Functions, Docker, AWS Lambda, or inside Android or iOS, you know how much a PITA it is (if it's even possible). PeachPDF? It just works in all of these places, because its 100% C#

And performance? It's essentially instant for most normal-sized documents using pretty minimal amounts of memory. I haven't formally benchmarked it yet (I will at some point soon), but the peak memory usage is going to be early in the rendering pipeline while the CSS tree is applied to the DOM tree parsed from HTML. Layout is one of the most significant CPU-intensive portions, but its essentially just calculating X, Y, Width, and Height for every DOM element, so its not excessively expensive.

The best part? This is all 100% free and open source at https://github.com/jhaygood86/PeachPDF

reddit.com
u/jhaygood86 — 17 hours ago
▲ 31 r/dotnet+1 crossposts

OpenLogi.net - an Options+ replacement for Windows. Open source, no cloud, no background bloat

I've been building openlogi.net , an app for controlling Logitech mice and keyboards on Windows — and it's at a point where I'd love for people to try it.

It talks to your devices directly over HID++ (Bolt/Unifying receiver, Bluetooth, or wired), so everything stays on your machine: no account, no cloud sync, no telemetry.

The porting story: this began as a port of the excellent Rust project AprilNEA/OpenLogi. The original leads on macOS and Linux - Windows is an early, untested preview there. I'm on Windows, so rather than bolt Windows support onto a Rust/GPUI codebase, I rewrote it in C# / .NET + Avalonia.

Because the whole thing is built around Windows first, it's grown more capable on Windows than the original's Windows preview — fuller device support, RGB lighting (per-key colors and effects), onboard and per-app profiles, multi-host switching, and a proper installer. It's an independent project, but huge credit to the upstream OpenLogi for the foundation and the reverse-engineering work.

What it does:

- Discovers your devices + shows battery level

- Button remapping

- DPI control + presets

- SmartShift (wheel ratchet) tuning

- RGB lighting — colors, effects, brightness

Why you might like it:

- Small + self-contained — ~16 MB installer (or a portable zip), and you don't need .NET installed

- No account, no telemetry, fully open source (MIT)

- Installer and a no-install portable build on the releases page

⬇️ Download / source: https://github.com/loxsmoke/openlogi-net

I've tested it on the hardware I own, and since Logitech's lineup is huge, I'd genuinely love to hear how it runs on your device — open an issue with your model and what worked. One quick tip: close Options+ first, since both apps want to talk to the device at the same time.

Not affiliated with Logitech. Feedback, ideas, and PRs all very welcome — hope it's useful!

u/loxsmoke — 19 hours ago
▲ 0 r/dotnet+1 crossposts

DataVo v0.1 Alpha: I built a C#-native embedded database that hits 2.3M OPS by bypassing the GC

I’ve been working on DataVo, an open-source, embedded SQL + vector engine written entirely in C#. There are no native C/C++ binaries to bundle or cross-platform targets to fight with, it’s just a single managed library.

When you build a database engine in .NET, the garbage collector is your ultimate bottleneck. Object allocations on every operation completely destroy your P99 latency due to Gen 0 churn. To get around this, the entire engine is designed for zero steady-state allocations in the hot path.

A few ways it does that:

  • The write path is an LSM tree where the MemTable rents 32MB slabs from ArrayPool<byte>.Shared. Rows are serialized directly into the raw byte arrays using a bump allocator, so the GC never even tracks them.
  • It uses Roslyn source generators to compile query execution paths at build time. If you annotate a query, it generates a static, typed row reader that maps straight to your CLR type, skipping runtime AST parsing and avoiding object boxing.
  • Vector search runs flat and HNSW paths entirely over contiguous managed memory using System.Numerics.Tensors, eliminating the P/Invoke marshaling tax.

I ran the benchmarks on a standard, noisy GitHub Actions Linux runner against SQLite and LiteDB to see how it handles real-world cloud hardware. On a mixed concurrent workload, it hit 2,368,026 ops/sec (SQLite hit ~199k on the same box). For a 10k vector workload, it allocated about 10MB of memory, while LiteDB's brute-force path churned through 208GB of garbage.

To be entirely transparent about where it loses right now: SQLite's native sqlite-vec extension has a tighter C-kernel and still wins on single-query vector latency (3.1ms vs 10.5ms). Also, my current HNSW graph construction is single-threaded and brutally slow, taking 160 seconds to build an index that SQLite finishes in under a second. That's the next big optimization target.

The repo and deep-dive article are below. I'd love to get your thoughts on the architecture or have you guys try to break it.

Full Write-up: https://medium.com/@arintonakos/bypassing-the-net-gc-how-i-hit-2-3-million-ops-with-a-c-native-embedded-database-bfeac66c5cac

GitHub Repo: https://github.com/ArintonAkos/DataVo-DBMS

reddit.com
u/arintonakos12 — 23 hours ago
▲ 67 r/dotnet+1 crossposts

I made a tool that generates Markdown-friendly database schema

I built with C# a small tool called DbSketch.

The idea is: point it at the real database, and it generates schema documentation that can live in your repository. It reads tables, columns, primary keys, foreign keys, and database comments, then outputs diagram-as-code formats like Mermaid, Graphviz DOT.

I originally made it because I wanted a lightweight way to keep database structure visible and version-controlled. It also useful when working with coding agents like Claude or Codex. Instead of trying to guess db structure from code or from migrations script (burning tokens) it could simply read it from markdown files.

NOTE: Mermaid format could show relation only as table to table lines VS dot format could show filed to field relation!

GitHub: https://github.com/DimonSmart/DbSketch

I’d really appreciate feedback from people who work with database-heavy projects. Does this solve a real annoyance for you? Is anything missing or unclear? Suggestions, criticism, feature ideas, and PRs are very welcome.

u/DimonSmart — 1 day ago
▲ 7 r/dotnet+1 crossposts

Server recommendation where should I deploy my .net 10 api

Building a .net 10 web api for a client and I am overwhelmed by server choices. Azure vs AWS or Digital ocean, managed vs unmanaged VPS. What is your go to choice when deploying for a client, Tech-stack
Redis, PostgreSQL, Blob Storage required. S3 or Azure Blob

reddit.com
u/nahum_wg — 1 day ago
▲ 0 r/dotnet+1 crossposts

I wrote a Visual Studio extension for Solidity development and deployment that automatically generates C# smart contract bindings

Visual Studio is heavily used for enterprise development but doesn't have any tooling for Solidity that compares to Visual Studio Code or Remix IDE. Viscous is an open-source Visual Studio extension that tries to bring parity between Visual Studio and other IDEs for Solidity smart contract development.

Features

  • Solidity project system for Visual Studio featuring Solidity compiler integration and NPM dependency management. Integrates with the Visual Studio New Project… and Open Folder… dialogs.
  • Uses the vscode-solidity language server for syntax highlighting, hover information, IntelliSense, and linting.
  • Solidity compiler integration with MSBuild and the Visual Studio Build command - compile Solidity projects and individual files from the IDE with errors reported in the Errors tool window.
  • Generate C# bindings to Solidity smart contracts automatically using Nethereum.
  • Manage EVM networks, endpoints, accounts, deploy profiles, and deployed contracts from the Blockchain Explorer tool window.
  • Deploy a compiled contract to a blockchain network and call its functions from inside Visual Studio.
  • Find vulnerabilities and code‑quality issues with Slither static analysis inside Visual Studio.

Requirements

  • Visual Studio 2022 and above
  • A recent version of Node.js or compatible runtime
  • Python 3.8+

Getting Started

Note that this is a pre-release so don't use it for deploying anything to production. Feedback welcome.

u/allisterb — 18 hours ago
▲ 1 r/dotnet+2 crossposts

Complete Medical Cabinet Management System - VB.NET & MySQL | Full Tutorial

Hi everyone! 👋

I'm excited to share a complete Medical Cabinet Management System I've built using VB.NET and MySQL.

**✨ FEATURES:**

### 👤 Patient Management

- Complete CRUD operations

- Search functionality

- Emergency contacts

- Insurance information

### 📅 Appointment Scheduling

- Conflict detection

- Status tracking

- Date-based search

- Doctor assignment

### 📋 Medical Records

- Diagnosis tracking

- Symptoms recording

- Treatment history

- Clinical notes

### 💊 Prescriptions

- Medication management

- Dosage and frequency

- Duration tracking

- Active/Inactive toggle

### 💰 Billing & Invoicing

- Automatic invoice numbering

- Tax calculation

- Multiple payment methods

- Professional printing

### 👥 User Management

- Role-based access

- Password reset

- Account activation

- Secure hashing

### 📈 Reports & Analytics

- 6 different report types

- CSV export

- Print capability

- Date range filtering

**💻 TECHNICAL STACK:**

- VB.NET Windows Forms

- MySQL Database

- SHA256 Encryption

- 3-Tier Architecture

- Repository Pattern

**📥 GET THE SOURCE CODE:**

  1. Watch the full demo: [YouTube Link]

  2. Comment "I want the code"

  3. I'll send you the complete project!

**📊 Statistics:**

- 12+ forms

- 8+ database tables

- 7 main modules

- 1000+ lines of code

- Modern UI/UX design

**🔥 Perfect for:**

- Medical clinics

- Students learning VB.NET

- Developers building portfolios

- Healthcare IT professionals

**🤝 Feedback is welcome!**

#VB.NET #MySQL #MedicalSoftware #OpenSource #Programming

youtube.com
u/Vegetable_War3060 — 1 day ago
▲ 1 r/dotnet+2 crossposts

HPD-AI Framework: Make AI agents, RAG, Auth, TUI, Workflows in .NET

Hi guys,

I would like to introduce the HPD-AI Framework. It is an all in one solution for specific parts of an ai application development: AI Agents, RAG, Workflows, Machine Learning and even TUI application development in .NET. I am still not done and everything is pre 1.0.0  but I wanted to let you guys know and I hope this brings value to any one is the community that might have needed something like this. 

Think of this like Tanstack but for mainly ai related stuff and its .NET

Check it out here if you are curious, if you have any questions let me know in the comments.

Documentation for all isnt ready yet but coming pretty soon.

https://github.com/HPD-AI/HPD-AI-Framework.git

reddit.com
u/Southern-Holiday-437 — 21 hours ago
▲ 0 r/dotnet+1 crossposts

Best way to change app storage location for end-to-end testing

I'm playing with a toy project to learn some programming techniques. It's a C#, WPF app. I do dependency injection manually, without containers.

The app needs to store a SQLite DB somewhere, which defaults to AppData/Local. During composition (in App.xaml.cs), the default path is injected into a repository class, and away we go.

I feel like I should use a temporary test storage location that can be cleanly setup and torn down without interfering with any actual app installs on my machine.

For unit testing, it's easy enough to pass in something else to the repository class. For end-to-end testing (using FlaUI) the default path is used. I'm looking for options to change this default path at test-time. I've gone through several ideas:

  • Command-line argument: Don't like this idea, as there is no purpose for it outside of testing. The underlying logic would wind up in production code.
  • Command-line argument, but with #if DEBUG directive: Strips the logic, but now I can't end-to-end test Release.
  • Config file: The app still needs a default place to look for it, so I'm back to square one.
  • Temporarily override the LOCALAPPDATA environment variable during testing: GetFolderPath() does not use the environment variable to resolve the path.
  • Reference LOCALAPPDATA instead of GetFolderPath(), and temporarily override LOCALAPPDATA during testing: This is the best I got so far

This isn't a real app and I'm not a real programmer, but nevertheless I'd like some opinions on what the best technique would be. Shirley I'm not the first to come up against this.

reddit.com
u/TseehnMarhn — 21 hours ago
▲ 4 r/dotnet

What is a modal thread?

What does it mean to define a thread as modal? For some reason I this isn't specified in the docs. I have checked the docs for ComponentDispatcher.PushModal() and all it says it that the current thread will be set to modal. It provides no insight of what it means to actually set a thread to be modal. What does it mean for a thread to be modal in terms of execution and message loops?

reddit.com
u/linux4117 — 1 day ago
▲ 9 r/dotnet+1 crossposts

Built a page RAG field manual while studying for Azure AI-103 if Any one preparing for AI-103 (.NET-flavored)

I was studying RAG for Microsoft's AI-103 cert and kept losing track of how all the pieces actually connect ingestion, chunking, embeddings, vector DB, retrieval, augmentation, generation, the agent , eval. Most of the reference material out there is written from a Python/LangChain angle, and I'm coming at this from the .NET/Azure world, and I like visuals/structured learning.

It's a static HTML page covering the whole pipeline end to end, with a free/open-source alternative called out at each step not just the usual Pinecone/OpenAI defaults.

Mainly built it to learn figured it might be useful to anyone else piecing RAG together, especially if you're coming from a non-Python background. Feedback welcome, especially if I got a tradeoff wrong somewhere.

reddit.com
u/sakamoto_hoto — 1 day ago
▲ 96 r/dotnet

Announcing LibreWPF

Announcing LibreWPF

Today I'm introducing LibreWPF—an open-source, free, cross-platform implementation of Windows Presentation Foundation (WPF).

The goal of LibreWPF is simple: preserve the WPF programming model while making it available across modern platforms, including Windows, macOS, Linux, with future support for iOS, Android, and the browser. Existing WPF applications should require little to no code changes, allowing developers to reuse their skills, libraries, and applications beyond Windows.

Powering LibreWPF is ProGPU, a modern high-performance GPU rendering engine designed for demanding desktop applications. ProGPU delivers hardware-accelerated rendering, enabling complex user interfaces, vector graphics, CAD, visualization, and other graphics-intensive workloads while remaining portable across platforms.

Together, LibreWPF and ProGPU aim to give the .NET ecosystem what it has wanted for years: a truly open, high-performance, cross-platform future for WPF.

This is only the beginning, and community contributions are welcome as we build the next generation of WPF together.

Roadmap

LibreWPF

  • Achieve high compatibility with the WPF API and XAML ecosystem.
  • Run existing WPF applications on Windows, macOS, and Linux with minimal or no code changes.
  • Expand support to iOS, Android, and WebAssembly.
  • Deliver a modern, high-performance rendering pipeline powered by ProGPU.
  • Support the broader WPF ecosystem, including third-party control libraries.
  • Build a complete open-source development experience with tooling, diagnostics, testing, and designer support.
  • Foster an open governance model driven by community contributions.

ProGPU

  • Deliver a portable, high-performance GPU abstraction for .NET.
  • Support modern graphics backends including WebGPU, Vulkan, Metal, Direct3D 12, and OpenGL where appropriate.
  • Optimize for desktop-class applications such as CAD, scientific visualization, UI frameworks, game tools, and creative software.
  • Continue advancing GPU-accelerated vector graphics, text rendering, image processing, and compute workloads.
  • Provide a stable foundation not only for LibreWPF, but for other .NET UI frameworks and graphics applications.

GitHub

u/wieslawsoltes — 2 days ago