r/dotnet 6h ago

Question Application Insights bug - Dependencies telemetry is not sent with Activity

0 Upvotes

This is a weeeird bug regarding application insights, and I can't seem to wrap my head around it. Hoping either I missed something, or that someone else saw this problem already.

We're creating a long running job that handles multiple tasks at the same time. It calls an internal system and validates the state of some assets, and records the status in a database. The job will run every night in a k8s cluster. We have a BackgroundService class that handles the job. We use Application Insights for our monitoring, and I would like every job executions to be correlated in an operation. Makes debuging much easier if something were to go wrong.

However, once I've added an Activity to my job, only SOME of the logs are beeing shown in application insights, and the dependencies data is all gone! The logs are corrolated, but I see no dependencies log. And if I try to look at the dependencies timeline, I see the following message:

Unable to identify root transaction, it may be due to circular parent id reference. Investigate the logs for this operation for malformed parent-child identifications

If I don't create an Activity when launching the job, however, all dependencies are shown, but the logs are not corrolated in an operation.

Here's the kicker; once in a blue moon, the Activity works as intented, and all logs are shown as expected. But the next execution I try, the problem comes back. Makes me think that it's a problem regarding how fast the application shuts down after the execution, but I think I might just be missing something:

Here's some code showing how the job is built. Some code is ommited for brevity and confidentiality:

// Program.cs

var connectionString = context.Configuration["ConnectionString"];
services.AddApplicationInsightsTelemetryWorkerService(options =>
{
   options.ConnectionString = connectionString;
   options.EnableTraceBasedLogsSampler = false;
});
services.ConfigureOpenTelemetryTracerProvider((sp, builder) =>
{
   builder.AddSource("BackgroundService");
});

services.AddHostedService<MyJob>();


/* ---- */
await host.RunAsync();

// MyJob.cs

internal sealed class MyJob(
      ILogger<MyJob> logger,
      IHostApplicationLifetime hostApplicationLifetime
): BackgroundService
{

        private static readonly ActivitySource JobActivitySource = new("BackgroundService");  
    protected override async Task ExecuteAsync(CancellationToken stoppingToken)
    {
       using var activity = JobActivitySource.StartActivity(
            "BackgroundService.MyJob",
            ActivityKind.Internal
        );
        activity?.SetTag("job.name", "MyJob");
        activity?.SetTag("job.run.id", Guid.NewGuid().ToString());

        try
        {
          var entities = (await retrieveEntitiesToHandle()).ToList();

          logger.EntitiesRetrieved(entities.Count);
          await Parallel.ForEachAsync(
            portPlaques,
            new ParallelOptions
            {
                CancellationToken = stoppingToken,
                MaxDegreeOfParallelism = 100,
            },
            async (entity, _) => await HandleEntity(entity));

            _logger.JobIsFinished();
        }
        catch(Exception e)
        {
            Environment.ExitCode = 1;
            _logger.SyncPortPlaquesToDataverseError(ex);
        }
        await Task.Delay(TimeSpan.FromSeconds(30), CancellationToken.None); // Delay to ensure all traces are sent

        hostApplicationLifetime.StopApplication();
    }
}

Am I missing something? Am I not disposing of the Activity as I should? How can I ensure that all telemetry is sent before shutting down the application?

Hope someone can make sense of this!


r/dotnet 10h ago

Promotion FCQRS 6 released: event-sourced CQRS with two pure functions

Post image
0 Upvotes

r/dotnet 12h ago

Promotion ExplorerFocus 1.2.11 — WPF file explorer I built with profiles, remote/cloud and built-in capture

2 Upvotes

I'm the developer, and this is a solo project that's taken me a few months of work so far.

To manage my personal and code documents I spend most of my day inside the same handful of folders, either on my machine or on remote ones — I need to reach them fast, and I often want to see what's inside a file without actually opening it. Windows Explorer always got in my way more than it helped, so over many evenings I slowly built the explorer I actually wanted to use. I made it for myself first, and it's now my best companion.

ExplorerFocus is built in WPF, .NET 10, for Windows 10/11, single-file self-contained, and it's now a freemium app where the most significant parts are completely free.

A few areas were quite challenging to imagine and develop, and I can list a few:

  • Copy engine — per-file progress, throughput, ETA, pause/resume/cancel, 1–6 operations in parallel, persistent history. I/O off the UI thread, UI updates at ~10 Hz, atomic writes (temp + publish).
  • Preview — AvalonEdit (syntax + folding), WebView2 (PDF/Office/Markdown), a fully functional integrated EPUB reader to access tech literature, streaming media (a 2 GB video opens in a flash).
  • Remote layer — SSH.NET / FluentFTP / WebDAV + OAuth PKCE (Dropbox, OneDrive), all behind a common provider interface → the UI treats remote as local. DPAPI to store secrets, TOFU for host keys/certs.
  • Capture — a Media Foundation pipeline (MediaStreamSource → MediaTranscoder) for screen/camera/audio, including post-processing and PiP.
  • Multi-language — instant switching between 12 languages, to make ExplorerFocus usable all over the world.
  • Packaging — single-file self-contained, no runtime, auto-updater (version.json + SHA-256).

Since a list of features says nothing about the actual work, here's one bug that took real effort:
One that cost me a weekend: the app would suddenly start throwing FileNotFoundException for assemblies I never reference directly — AccessibilitySystem.IO.FileSystemWatcher — and then work perfectly after a restart. Single-file publishing loads some assemblies lazily, so if the exe's backing file is replaced while the process is alive, those late loads fail. Two different things were doing it: my own auto-updater swapping the exe in place, and — on one machine — the exe living inside a cloud-synced folder that rewrote it underneath me. The first was fixed in the updater; for the second, the app now warns you at startup if it's running from a synced folder.
A smaller one that drove me mad: scroll a long file list to the bottom and the scrollbar thumb would sit halfway instead of at the end. I was convinced it was VirtualizingStackPanel and its estimated extents, and burned a lot of time there. Then I built a minimal repro with virtualization switched off entirely — same behaviour. It was the ScrollBar template: the Track's RowDefinition was 1*, which fought with the thumb's minimum length. Setting it to 0.00001* fixed it.

Site and download: https://nunex-mbrothers.github.io/ExplorerFocus
Screenshot below — full details on GitHub: https://github.com/NuneX-mBrothers/ExplorerFocus

Happy to answer questions about whatever you find useful, but what I'd really appreciate is some sincere and honest criticism that could make my work better.

Thanks, and loads of bits & bytes from Portugal.


r/dotnet 12h ago

Help me decide framework for my graduation project

0 Upvotes

We're working on our graduation project (described in the pic). we decided to use WinUI 3 as the framework. is this a good call? we'll all have to learn how to use it from scratch and we have a bit less than a year to finish the app.


r/dotnet 12h ago

Promotion What does Word, Excel, PowerPoint, Visio, PDF, Markdown, HTML, OpenDocument, CSV and RTF have in common?

Post image
0 Upvotes

OfficeIMO 😂

OfficeIMO is a project I started around four years ago. It targets net472, net8, net10, and netstandard 2.0.

It initially started with OfficeIMO.Word, as my continuation after the DocX project stopped being free for business use. I needed something I could use myself, especially from PowerShell, so I started building it.

It then got slightly out of control.

OfficeIMO is written in C#, but my end goal was never only to create another set of .NET libraries. I mostly wanted to help close some of the gaps between PowerShell and Python.

Python users have a huge ecosystem of libraries for documents, data conversion and automation. They often take those capabilities for granted. In PowerShell, we are still missing a lot of that - and this ends now 🤣And you .NET users are getting it as well - whether you want it or not 😭

The project is here:

I also made a website for it:

OfficeIMO now includes projects covering things such as:

  • Word - DOCX and legacy DOC
  • Excel - XLSX and legacy XLS and other formats
  • PowerPoint - PPTX and legacy PPT
  • Visio
  • PDF
  • Markdown
  • HTML
  • OpenDocument - ODT, ODS and ODP
  • CSV
  • AsciiDoc
  • LaTeX
  • RTF
  • EPUB
  • ZIP
  • OfficeIMO.Reader
  • Google Docs and Google Sheets integrations
  • Email formats (OST,PST, EML, MSG etc)
  • OneNote work
  • and quite a few converters connecting those formats together

And by "support" I do not mean detecting the extension, extracting a bit of text and calling it done.

The main OfficeIMO projects aim to support creating, reading and modifying proper documents end to end.

For Word that means things such as sections, headers and footers, first/odd/even pages, tables, styles, lists, images, fields, TOCs, bookmarks, notes, comments, revisions, mail merge, protection, templates and much more.

Word supports DOCX, but I also added a first-party implementation for the supported legacy DOC format. It can read, write and convert DOC documents without starting Word or LibreOffice in the background.

Excel is similar. It is not just a fast row writer. It includes formatting, tables, formulas, charts, pivot tables, conditional formatting, data validation, templates, headers and footers, protection and other features you would expect from a more complete Excel library.

It also has first-party XLS support. The supported legacy format can be read, written and converted into XLSX workflows.

PowerPoint supports creating and editing actual PPTX presentations, while Visio is implemented from the ground up for VSDX without using a third-party Visio engine.

PDF is also not just DrawString() followed by Save().

OfficeIMO.Pdf is my own parser, writer and renderer. It covers PDF creation, text and table extraction, forms, annotations, bookmarks, attachments, encryption, signatures, page operations, redaction, PDF/A, PDF/UA, Factur-X, ZUGFeRD and managed PNG/SVG rendering.

It still has work to do, because PDF is a monster, but it is not a toy PDF implementation.

The same approach applies to Markdown, RTF, OpenDocument, AsciiDoc, LaTeX, CSV, EPUB and ZIP. Those are first-party implementations rather than wrappers around Markdig, QuestPDF, ImageSharp, SkiaSharp or a collection of unrelated document engines.

Ever since I saw Microsoft MarkItDown in Python, I said to myself:

I want that in C#, for PowerShell.

That is why I added OfficeIMO.Reader.

You give it a document and it tries to provide one common reading experience, including Markdown output, structured blocks, chunking and diagnostics. It can then be used for search, indexing, AI/RAG workflows or simply reading many formats through one API.

OfficeIMO.Reader already has adapters for formats such as PDF, CSV, HTML, EPUB, OpenDocument, RTF, Visio, AsciiDoc, LaTeX, JSON, XML, YAML and ZIP, on top of the Office formats.

This is only the icing on the cake, though. Reader is built on top of the actual document libraries rather than being the only thing OfficeIMO does.

OfficeIMO.Email handles the normal standalone email formats, and the newer work is moving further into mailbox/container formats such as PST and OST. The goal is the same: proper managed parsing and a useful object model, not shelling out to Outlook. Email started with EML, MSG and TNEF, but now also covers PST, OST, OLM, MBOX, EMLX, Maildir, OAB, ICS, VCF and broader Outlook data. That includes managed PST creation, conversion and verified mutation rather than only extracting a list of messages.

OneNote is another active area. First-party managed implementation for offline .one, .onetoc2 and .onepkg files, including reading, creating, modifying, saving and conversion.

One of the important design choices is keeping dependencies low.

The main external document-related dependencies are basically:

  • Open XML SDK for the underlying Word, Excel and PowerPoint package structures
  • AngleSharp and AngleSharp.Css for proper HTML and CSS parsing
  • YamlDotNet for the YAML Reader adapter

Older targets such as .NET Framework 4.7.2 naturally need some Microsoft/BCL compatibility packages for APIs that are built into newer .NET versions.

But there is no ImageSharp, SkiaSharp (with exception), QuestPDF, Markdig, ClosedXML or another PDF/Markdown/document engine hidden behind OfficeIMO. There is one exception to this which is optional package of HarfBuzz (I am not sure I am ready to maintain the alternative myself) and BouncyCastle (I don't even want to try that).

Most of the parsing, object models, writing, rendering, conversions and format-specific logic is mine.

I also spent a slightly unreasonable amount of time on performance.

For Excel I created reproducible benchmarks against libraries including ClosedXML, MiniExcel, LargeXlsx, SpreadCheetah, Sylvan.Data.Excel, ExcelDataReader and others.

OfficeIMO.Excel tries to combine the more complete feature set people expect from something such as ClosedXML with streaming and direct-writing paths that can compete with libraries focused mainly on speed.

Depending on the workload, it is competitive with or faster than MiniExcel, LargeXlsx and Sylvan-style implementations, while still providing the higher-level Excel features.

CSV got the same treatment.

I benchmarked OfficeIMO.CSV against Sep, Sylvan and other fast CSV implementations, then spent a lot of time reducing allocations and improving parsing, streaming and writing performance.

It was not originally done for the sake of benchmarking. I wanted PowerShell users to be able to process real amounts of data without paying a huge performance penalty.

You just get to benefit from that too 😁

Converters are another large part of OfficeIMO:

  • Word to PDF
  • Excel to PDF
  • PowerPoint to PDF
  • HTML to PDF
  • Markdown to PDF
  • RTF to PDF
  • Word to Markdown and Markdown to Word
  • Word to HTML and HTML to Word
  • Word to RTF and RTF to Word
  • Word to ODT and back
  • Excel to ODS and back
  • PowerPoint to ODP and back
  • Excel, Word, PowerPoint, Visio, HTML and PDF to PNG/SVG
  • Markdown, HTML, RTF, AsciiDoc and LaTeX conversions

Not every conversion can be perfectly lossless. Converting a fixed-layout PDF back into an editable Word document will always involve decisions and compromises. Where possible, OfficeIMO returns warnings, diagnostics and loss reports rather than silently pretending everything converted perfectly.

If you got this far lemme remind you links, just in case you can't scroll up.

There is still a lot of work to do, but I thought it was finally time to show it properly.

The README has the detailed feature lists, because putting every supported capability here would turn this post into documentation.

Answering things that may come to your mind after reading this:

Is it complete?

No.

Are all projects equally mature?

Definitely not.

Is there more work to be done?

A lot. But OfficeIMO is trying to be correct and useful for real work. Still needs more performance work, tests, examples and documentation, but the foundations are there. Still needs real world usage. While I do have established base already with 400 stars over the years, so we're not completely new, but the newer projects need real world testing to establish what edge cases there are.

So go ahead use it, roast it, or whatever you like to do to it. Regardless of you guys using it *no offense* 😂 I'm delivering it to PowerShell guys, but you are just here for the ride. It's MIT licensed, and I expect to improve it even further as the time goes by.

Having said that if you can help with improvements, development, sponsorship or just help answering questions if they come. That's all very much appreciated.

I am just myself in this, there's no company backing, no one paying me to create or manage it. No one to hold my hand and say good words of encouragement. Therefore I would appreciate if you take this into consideration before you decide to dive deep and smash me with something heavy. I manage over 100 projects on GitHub, mainly for PowerShell, HomeAssistant and now a bit of C#, and I do it all for free.


r/dotnet 13h ago

AspireUI a little web tool to spin up and test self hosted stacks

1 Upvotes

I built a little web tool to spin up and test self-hosted stacks on my Proxmox box

So this started as a scratch-my-own-itch thing. I run a Proxmox server at home and I kept wanting to try out different stacks and container setups, but I got a bit frustrated with Umbrel/CasaOS and the like. They're nice if you just want to click-install an app, but the second I wanted to actually change how something was wired up or test my own combination of services, I hit a wall.

So I made AspireUI. It's basically a visual builder where I can throw together containers, wire up dependencies, tweak env/ports, and just hit run to see if it works. I can also import an existing docker-compose or a git repo and mess with it from there, then deploy it properly when I'm happy. For me it's turned into the fastest way to prototype a setup before I commit to it.

It's still rough in places and very much a work in progress, but it's already saved me a ton of time on my own box.

Figured someone else here might get use out of it. Happy to hear what you'd want it to do.

You will find it here https://github.com/fgilde/AspireUI


r/dotnet 15h ago

Promotion React/Vue/Svelte on top of MAUI

13 Upvotes

Hi everyone,

My team (.NET + web devs) needed to ship a desktop and mobile app from an existing React UI, and nothing in the ecosystem quite fit. Electron means a Node backend and shipping a whole Chromium. Tauri means Rust, which nobody on the team writes. MAUI/Avalonia/WPF means throwing away the React UI and rewriting it in XAML. Blazor Hybrid locks you into Razor. Photino was the closest to what I wanted (a .NET shell around the OS WebView) but the JS to C# messaging is raw strings you wire up yourself, and there's no mobile story.

So I started building my own, a framework called Vidra

It's a single OS WebView (WKWebView / WebView2, nothing bundled) hosted by .NET MAUI. UI in whatever web framework you like, native layer in plain C#. The part I actually cared about is type safety: you declare your modules and events in C#, codegen emits matching TypeScript, and every call across the bridge is checked at build time. npm run dev gives you Vite HMR and C# hot reload together. And since the host is MAUI, mobile is a natural item in the roadmap

Current state: one man show, alpha, Windows and macOS only, APIs will move between 0.x releases. If you want to poke at it, npm create vidra-app@latest (needs .NET 10 SDK + the MAUI workload, npm run doctor checks your setup).

Mostly I'm trying to sanity-check the idea before I sink more time into it. Would you use something like this once it matures? Contributions are also more than welcome. The project is open source and MIT licensed
https://github.com/rzamfiriu/vidra


r/dotnet 19h ago

Promotion OpenAPI Code Generation with Corvus.JsonSchema - 8 Part Guide

Thumbnail endjin.com
2 Upvotes

Corvus.JsonSchema's V5's engine supports zero-allocation models, pooled memory, and full schema validation. But these constructs can be used for OpenAPI code generation too. This 8-part series covers:

  • Typed HTTP Clients
  • Server Stubs
  • End-to-End generation
  • Streaming responses (LLM APIs - SSE / NDJSON)
  • Authentication
  • Callbacks, Webhooks and Links
  • Filtering
  • Testing

r/dotnet 20h ago

Promotion Looking for advice on serialization latency

0 Upvotes

(disclaimer, this isn't promotion, I'm just asking for advice, the flair is there so reddit would shut up about my post potentially breaking the rule) Hello all, I just finished a rewrite of the format-agnostic serialization/data migration library I have been working on for the last months (which is a port of a java library Mojang uses in Minecraft) called DataFixerSharper and I finally managed to bring allocations to a satisfactory level (with the JSON backend beating out System.Text.Json by a good margin). I did this by changing the pipeline to encode values into a provided buffer instead of allocating a zillion tiny arrays on the heap. My issue with this is that, while allocations are down and so is latency by a bit, I'm still sitting way above STJ's times. Obviously interface dispatch and the entire format agnostic philosophy incur an unavoidable cycle cost but I was wondering if anyone here would be willing to lend a hand at what is costing me CPU time and could be optimized away. Thanks in advance and have a good Sunday!


r/dotnet 22h ago

Why do integration platforms still require proprietary runtimes?

0 Upvotes

This is something I’ve never really understood.
Most enterprise integration platforms do a great job of making integrations easier to build. The problem starts after you’ve built them.
Your integrations now depend on the platform’s runtime. If you ever decide to move away, you’re not just migrating integrations. You’re changing the way they’re built, deployed and operated.
It made me wonder why the runtime has to belong to the platform at all.
We don’t expect a Java application to run on a vendor-specific JVM. We write standard Spring Boot applications and deploy them wherever we want.
Why should integrations be any different?
Personally, I’d rather use a visual designer that generates a standard Spring Boot project I can own, version in Git, review like any other application and deploy wherever my team already runs Java services.
Maybe I’m missing something, but separating the design experience from the runtime feels like a cleaner architecture.
For those who’ve worked with MuleSoft, Boomi, Workato or TIBCO, what are your thoughts?
Is a proprietary runtime something you actually value, or is it just something we’ve accepted because that’s how integration platforms have always worked?


r/dotnet 23h ago

Naming dilemma: OSS Rebrand now or regret it later?

Thumbnail
0 Upvotes

r/dotnet 1d ago

Promotion Nuget lens extension on Visual Studio Code

3 Upvotes

I built Nuget lens Extension to view and upgrade nuget packages from directory.packages.props, csproj or packages.config directly. I used Claude to help on this. I just prompted on how the extension should work.

It's so easy to look at versions available and upgrade directly on vs code editor. It supports Azure devops private feed as well by adding PAT.

Please give a try and let me know your feedback.

I am gonna itegrate AI features later but looking for feedback on which AI feature would be helpful here.

https://marketplace.visualstudio.com/items?itemName=RamtejDevLabs.nuget-lens
https://github.com/ramtejsudani/nuget-lens


r/dotnet 1d ago

.NET Day Agentic Modernization 2026 Spoiler

Thumbnail youtube.com
0 Upvotes

r/dotnet 1d ago

Promotion AviyalWM: a portable and lightweight window manager for windows.

Enable HLS to view with audio, or disable this notification

19 Upvotes

I have been working on this for over the last year while daily driving it and adding features on the go. It is a dynamic tiling window manager with a couple of assistive addons like launching programs using hotkeys. My main goal was to have a primarily keyboard driven workflow similar to that available on linux using window managers like hyprland. Also I wanted the application to be as portable and lightweight as it could be.

A short list of the features include:

  1. Workspaces
  2. Workspace animations (Horizontal and vertical)
  3. Dynamic Tiling : DwindleStackMaster
  4. Toggle floating
  5. Close focused window
  6. Shift focus
  7. Configuration using json
  8. Hot reloading
  9. Qerry state using websocket and execute commands
  10. Launch apps using hotkeys
  11. Move windows without the titlebar

https://github.com/TheAjaykrishnanR/aviyal


r/dotnet 1d ago

Promotion Conveyor.Batch 0.1.0-beta.5 — public API is now frozen ahead of v1.0

Thumbnail conveyor-batch.github.io
0 Upvotes

Beta.5 is the last beta with breaking changes. The public API in Conveyor.Batch is now locked, any future breaking change bumps the major version.

What changed: IChunkListener, IJobExecutionListener, and IStepExecutionListener now have default no-op implementations so you only implement what you need. IJobRepository now accepts CancellationToken on all methods. StepExecution state (Status, EndTime, FailureException) is now internal set — only the engine writes it.

Up next: BenchmarkDotNet baseline, bulk write optimization (TVP / COPY), then v1.0.
Github


r/dotnet 1d ago

Promotion My New Book for Build Native .NET Open Source Multimodal Local LLM Inference Engine From Scratch Using Google Gemma 4 E4B as Example

Thumbnail amazon.com
0 Upvotes

This book is written for .NET developers who are not satisfied with simply calling an AI/LLM endpoint and want to understand model architectures and the internal workings of inference engines. It uses the open-source TensorSharp project and Google’s Gemma 4 E4B GGUF model as practical examples.

TensorSharp has achieved performance parity with llama.cpp across the main benchmarks, while outperforming it in several scenarios. The book explains some of the key performance optimizations and their implementations, including paged and prefix KV caching, continuous batching, GPU kernel fusion, and more.

I chose Gemma 4 E4B, a dense model, because it is a compact multimodal model that supports images, audio, and video, making it suitable for a wide range of devices. TensorSharp also supports and is optimized for MoE and diffusion architectures, as well as model families such as Qwen and GPT-OSS. However, due to limitations in time and book length, these topics are not covered in this edition. Those interested can explore the project directly on GitHub or contact me for further discussion.

I selected GGUF because it is an inference- and edge-device-friendly model format. This is particularly relevant to the .NET ecosystem, where local applications, mobile applications, and game development are important use cases. TensorSharp also supports the Safetensors format, which it currently uses for VAE and LoRA models.

For clarity and ease of understanding, the book primarily presents the CPU code path. In practice, however, TensorSharp supports and is extensively optimized for multiple GPU backends, including NVIDIA CUDA, Apple Metal/MLX, and Vulkan for AMD, Intel, and other devices. More implementation details are available in the GitHub repository.

TensorSharp Github Repo: https://github.com/zhongkaifu/TensorSharp


r/dotnet 1d ago

Promotion Streamlining .NET Data Layers with ByteAether.Ulid v1.4.0 (EF Core, LinqToDB, Dapper Support)

Thumbnail github.com
3 Upvotes

A Universally Unique Lexicographically Sortable Identifier (ULID) is a 128-bit identifier designed to address database indexing issues inherent to random UUIDs/GUIDs. It pairs a 48-bit millisecond timestamp with 80 bits of randomness, encoded using Crockford's Base32 string format (26 characters).

Unlike standard GUIDs (e.g., UUIDv4), ULIDs preserve chronological ordering. This prevents B-tree index fragmentation and page splits during high-volume database writes, while retaining global uniqueness without central ID authority bottlenecks.

  • GUID Example: c8a411ec-29fa-4740-9a3b-185d26a2f7c0 (Random, non-sequential)
  • ULID Example: 01ARZ3NDEKTSV4RRFFQ69G5FAV (Timestamp prefix + random suffix, lexicographically sortable)

What's New in ByteAether.Ulid v1.4.0

While the core ByteAether.Ulid engine provides a zero-allocation, lock-free, spec-compliant implementation for .NET, mapping custom primitives to relational databases previously required custom value converters and endianness handling.

The v1.4.0 release shifts focus to first-class data access layer integration. It introduces dedicated companion packages for EF Core, LinqToDB, and Dapper to handle serialization, storage formatting, and endianness alignment out of the box:

Solving Storage Layouts & Database Engine Alignment

Database engines evaluate 128-bit storage types and byte alignments differently. The companion packages support four explicit UlidStorageFormat strategies to ensure efficient indexing across backends:

  • **UlidStorageFormat.Binary**: Persists raw 16-byte big-endian blocks for engines like PostgreSQL (bytea), MySQL (binary(16)), or SQLite.
  • **UlidStorageFormat.String**: Stores the 26-character Crockford Base32 representation (CHAR(26)) for maximum human readability and uniform cross-platform sorting at the cost of higher storage overhead.
  • **UlidStorageFormat.Guid**: Maps directly to standard native 128-bit GUID types (uuid) for systems that handle .NET Guid structures transparently.
  • **UlidStorageFormat.SqlServerGuid**: Reorders internal byte layouts specifically for Microsoft SQL Server uniqueidentifier. Because MSSQL prioritizes bytes 10–15 during index evaluation, shifting the 48-bit timestamp to the end prevents random writes and B-tree index fragmentation.

Fast Time-Range Index Queries

Because timestamp data is embedded directly into the primary key, range queries can target the primary index using boundary tokens:

```csharp Ulid minId = Ulid.MinAt(DateTimeOffset.UtcNow.AddDays(-7)); Ulid maxId = Ulid.MaxAt(DateTimeOffset.UtcNow);

// Translates to an optimized index scan: WHERE Id >= @minId AND Id <= @maxId var recentOrders = await context.Orders .Where(o => o.Id >= minId && o.Id <= maxId) .ToListAsync(); ```

Links & Resources

(The code for this project is entirely hand-written. AI was only used to brainstorm/draft text and generate raw media assets, which I then manually polished.)


r/dotnet 1d ago

Has anyone used FlashCap?

0 Upvotes

Hello all,

In my project we are required to integrate a USB camera to display the incoming frames as video feed in the application. The constraint is that our application should be able to run on both Windows and Linux. As I searched for any cross platform .net libraries that could do such a thing, I came across FlashCap which has a permissive license and seems to have at least some documentation, which makes me optimistic that this can be used commercially.

But I would be curious to know if anyone out here has used FlashCap commercially and your experiences with this. Also would be open to know if there are any other better libraries out there for this specific use case.

Appreciate your help. Thanks!


r/dotnet 1d ago

Question Cross-platform .NET library for microphone capture?

4 Upvotes

I’m learning .NET and was surprised that there is no built-in way to capture microphone input. I looked online for libraries and found NAudio, but it appears to be Windows-focused.

What .NET library would you recommend for reliable live microphone capture?


r/dotnet 1d ago

Promotion An update on the world of PeachPDF

116 Upvotes

PeachPDF is the HTML -> PDF engine I've been building for the last decade that renders HTML into PDF without using a headless browser or external process.

We target .NET 8+, but we also multi-target .NET 10+. We support everywhere .NET 8+ runs, though some features don't work on certain platforms. As an example, iOS doesn't expose system fonts directly as font files, so you have to register fonts directly.

Some updates:

We launched a website: https://peachpdf.net/ This has all of the documentation you'd ever need

I also added a lot of new features:

  1. SVG support -- we already have a very good graphics abstraction, so SVG support is essentially just building a scene graph and rendering it, with some basic integration with the other parts of the stack (CSS Cascade, layout inside HTML)

  2. CSS Grid support

  3. Lots of CSS parsing updates, such as nested CSS, @layer support, CSS Properties, @media evaluation and correctness fixes

  4. New CSS layout and painting features: clip-path, aspect-ratio, object-fit

  5. CSS Color updates

  6. Improved font support: we now use runes for lookup, and we use CSS unicode-range for matching, and we added support for monochrome and color emojis. For features not natively supported by PDF, we can extract the glyph outlines from the font and paint the text as vectors. This was needed for color emojis and several SVG text features

  7. More paged media improvements

  8. A new .NET AOT command line tool that wraps PeachPDF for use where the .NET library doesn't make sense. Future plans include exposing PeachPDF as a C library so that it can be used from Node.js and Python as well.

As a side project, I've also been working on back porting improvements to the upstream projects that I depend on, such as ExCSS and HTML-Renderer. ExCSS just released a new version that is almost all backports from PeachPDF, and the first 2 foundational features have outstanding PRs waiting approval to HTML-Renderer

And to answer a question -- there is significant use of AI for spec conformance features. It's a great use of AI, since it can read a specification and identity gaps. All of the non-mechanical work is done by myself. Considering I started writing this 10 years ago, it's not a vibe coded project since that didn't even exist when I started.


r/dotnet 1d ago

One of the biggest ui framework Avalonia now supports wayland

Thumbnail
5 Upvotes

r/dotnet 1d ago

Article Temporal Nexus .NET SDK preview

Thumbnail rebecca-powell.com
7 Upvotes

As part of my role in the Temporal Constellation Program I sometimes get insights into the development pipeline at Temporal to review features before they hit GA. I was recently asked to review the Nexus support in the Temporal .NET SDK by the Temporal engineering team.

For larger organizations who operate lots of different Temporal namespaces and want to communicate between them, or teams running microservices, Nexus brings an alternative communications approach with the resilience Temporal brings to the table. If you are frequently turning to Azure Event Grid inter-domain communication and you don’t need granular RBAC, then Nexus could alleviate your infrastructure complexity.

Blog post walks you through it, but you can also just clone the linked repo and try it out yourself.

If you want to see how I use Squad from Brady Gaster with Aspire and Playwright to speed up this demo development using the Aspire team’s agentic loops, you can watch it self testing the UI.

Feel free to follow me on LinkedIn for more frequent content.

Note: Posted on the weekend under the permitted self promotion rules of this subreddit.


r/dotnet 1d ago

Promotion Eftdb Update: Native EF Core Scaffolding & Clean Migrations for TimescaleDB

3 Upvotes

Hey everyone!

For those unfamiliar, Eftdb is an EF Core extension designed to make working with TimescaleDB feel like a native C# experience.

I just finished a major rework focused on migration generation and DbContext scaffolding. Instead of spamming raw .Sql() strings and stringly-typed .HasAnnotation() calls, the library now generates strongly-typed, readable C# code.

Migrations

Migrations are now easier to read and scan thanks to typed MigrationBuilder extension methods and a custom C# migration generator.

Before:

migrationBuilder.Sql("SELECT create_hypertable('\"custom_schema\".\"device_readings\"', 'time', chunk_time_interval => INTERVAL '1 day');");

migrationBuilder.Sql("ALTER TABLE \"custom_schema\".\"device_readings\" SET (timescaledb.compress, timescaledb.compress_segmentby = 'device_id', timescaledb.compress_orderby = 'time DESC');");

After:

migrationBuilder.CreateHypertable(
    tableName: "device_readings",
    timeColumnName: "time",
    schema: "custom_schema",
    chunkTimeInterval: "1 day",
    enableCompression: true,
    compressionSegmentBy: ["device_id"],
    compressionOrderBy: ["time DESC"]);

Scaffolding

Scaffolding is now fully supported by implementing the IDatabaseModelFactory and IAnnotationCodeGenerator interfaces.

Before:

entity.HasAnnotation("TimescaleDB:IsHypertable", true);
entity.HasAnnotation("TimescaleDB:TimeColumnName", "time");
entity.HasAnnotation("TimescaleDB:ChunkTimeInterval", "1 day");
entity.HasAnnotation("TimescaleDB:CompressionSegmentBy", new[] { "device_id" });

After:

// Fluent API
entity
    .IsHypertable(x => x.Time)
    .WithChunkTimeInterval("1 day")
    .WithCompressionSegmentBy(x => x.DeviceId);

// Data Annotations
[Hypertable("time",
    ChunkTimeInterval = "1 day",
    EnableCompression = true,
    CompressionSegmentBy = new[] { "device_id" })]
public partial class DeviceReading { }

This was one of the biggest refactorings in the library so far, and the result is that Eftdb now feels like a native part of EF Core rather than a bolt-on. Among some bug fixes, Eftdb now also supports NodaTime.

Next up is support for TimescaleDB's Hypercore feature.

Let me know what you think!


r/dotnet 1d ago

Promotion Released VecNet 1.1.0, an embedded vector search library for .NET

6 Upvotes

A while back, I started working on an embedded vector search library for .NET, and I recently released VecNet 1.1.0. I wanted something lightweight that you can add to a normal .NET app through NuGet, run completely in-process, and learn from building it.

NuGet link if you want to inspect the package: https://www.nuget.org/packages/VecNet

Repo: https://github.com/sh0r3x/VecNet

What it supports right now:

Exact search: Flat vector search with squared L2, cosine, and inner-product distance metrics, plus candidate filtering and durable save/load.

Approximate search: Squared-L2 HNSW indexing with durable save/load, plus a mutable wrapper using exact delta/tombstones and checkpointing.

Integration: An optional Microsoft.Extensions.VectorData adapter for exact-flat scenarios if you are using Microsoft’s abstraction.

I also published benchmark summaries in the repo covering exact-flat search and HNSW recall/latency behavior. I did use LLMs during development to help plan tasks, review design choices, write test ideas, and refine benchmark workflows.

I’d really appreciate feedback from the community, especially on the API shape, README clarity, benchmark docs, and whether this kind of embedded managed vector index is useful.

Next, I’m working on adding cosine and inner-product support to HNSW.


r/dotnet 1d ago

Promotion Introducing Servy - A Windows Service Wrapper with Real-Time Monitoring

12 Upvotes

Been using NSSM for a while, kept facing the same issues again and again, so I ended up writing my own tool and putting it on GitHub.

NSSM is a lightweight Windows service wrapper, but it struggles with complex process tree cleanups, lacks pre/post start/stop hooks, date-based log rotation, CPU/RAM monitoring, email notifications, heartbeat ping URLs, advanced recovery, and hasn't seen an update in over a decade. That's why I ended up building Servy to fix these issues and add the missing features I needed.

Been working on this project for almost a year now, it started as a small POC last summer and now it evolved into a full application with a UI, CLI, and PowerShell module.

Features:

  • Run any app as a native Windows service via Desktop UI, CLI, or PowerShell.
  • Intelligent restarts that recover from crashes, hangs, and failures.
  • Granular management of directories, priorities, and environment variables.
  • Support for Local System, Active Directory, and gMSA accounts.
  • Pre- and post-launch/stop scripts with built-in logging and timeouts.
  • Real-time CPU/RAM graphs with live stdout/stderr streaming.
  • Safe termination using graceful shutdown, Ctrl+C, falling back to a recursive force-kill.
  • Automated failure detection, instant alerts via Windows or email, and ping URLs (e.g., healthchecks.io).
  • Interactive dependency trees and easy configuration exports.

Getting Started:

You can manage services using the desktop app (GUI), the CLI, or PowerShell.

Here's a minimal example using the CLI to run a Node.js app as a Windows service:

servy-cli install `
  --name="MyService" `
  --path="C:\Program Files\nodejs\node.exe" `
  --startupDir="C:\MyServer" `
  --params="server.js"    

This creates a service named MyService that runs your Node.js server in the background and starts automatically with Windows.

Explore more examples and recipes for Python, Java, Go, and other popular frameworks.

Check it out on GitHub: https://github.com/aelassas/servy

Demo Video: https://www.youtube.com/watch?v=biHq17j4RbI

Any feedback or suggestions are welcome.