Tag: C#
-
Where Unit Tests End and Integration Tests Begin - A Practical Boundary Guide
A practical guide to drawing the boundary between unit tests and integration tests by separating pure logic, formatting, wiring, environment differences, and...
-
Checklist for Safe Child-Process Handling in Windows Apps - Job Objects, Exit Propagation, stdio, and Watchdog Design
A practical guide to safe child-process handling in Windows applications, covering Job Objects, exit propagation, stdio draining, and watchdog design.
-
Serial Communication App Pitfalls - Framing, Timeouts, Flow Control, Reconnects, USB Adapters, and UI Freezes
A practical guide to serial communication app pitfalls in Windows, covering framing, timeouts, flow control, reconnects, USB serial adapters, and logging des...
-
How to Choose Between Windows Forms, WPF, and WinUI - A Decision Table for New Development, Existing Assets, Deployment, and UI Needs
A practical decision table for choosing between Windows Forms, WPF, and WinUI based on new development, existing assets, deployment, UI richness, and team cu...
-
Shared Memory Pitfalls and Best Practices - Synchronization, Visibility, Lifetime, ABI, and Security First
A practical guide to shared memory pitfalls and safer design, covering synchronization, visibility, lifetime, ABI, permissions, and recovery on Windows and P...
-
How to Measure and Compare Programming Language Speed Fairly - A Practical Guide for C#, C++, Java, and Go
A practical guide to comparing C#, C++, Java, and Go fairly, including benchmark design, warm-up, environment control, statistical reading, and concrete work...
-
How to Use a .NET 8 DLL from VBA with Early Binding via COM and dscom
A practical guide to exposing a .NET 8 class library through COM, generating a type library with dscom, and using it from VBA with early binding instead of l...
-
What to Check Before Migrating .NET Framework to .NET - A Practical Premigration Checklist
A practical premigration checklist for moving from .NET Framework to modern .NET, covering project types, unsupported technologies, NuGet dependencies, Packa...
-
What the .NET Generic Host Is - DI, Configuration, Logging, and BackgroundService Explained
A practical explanation of what the .NET Generic Host is, how it ties together DI, configuration, logging, IHostedService, and BackgroundService, and where i...
-
What Native AOT Is in .NET - Differences from JIT, ReadyToRun, and Trimming
A practical explanation of what Native AOT is in .NET, how it differs from JIT, ReadyToRun, self-contained deployment, single-file publishing, and trimming, ...
-
How to Choose Between PeriodicTimer, System.Threading.Timer, and DispatcherTimer - First Organize Periodic Work in .NET
A practical guide to choosing between PeriodicTimer, System.Threading.Timer, and DispatcherTimer, including async processing, ThreadPool callbacks, and WPF U...
-
Why It Is Worth Bringing Generic Host / BackgroundService into a Desktop App - Startup, Lifetime, and Graceful Shutdown Become Much Easier to Organize
When startup logic, periodic work, shutdown handling, logging, configuration, and dependencies begin to scatter across a Windows desktop app, bringing in .NE...
-
How to Turn C# into a Native DLL with Native AOT - Calling UnmanagedCallersOnly Exports from C/C++
A practical guide to publishing a C# class library as a native DLL with Native AOT and exposing UnmanagedCallersOnly entry points that can be called from C o...
-
WPF / WinForms async/await and the UI Thread in One Sheet - Where Continuations Return, Dispatcher, ConfigureAwait, and Why .Result / .Wait() Get Stuck
A practical guide to the relationship between async/await and the UI thread in WPF and WinForms, covering continuation destinations after await, Dispatcher /...
-
How to Use FileSystemWatcher Safely - Lost Events, Duplicate Notifications, and the Traps Around Completion Detection
A practical guide to FileSystemWatcher that explains missed events, duplicate notifications, completion-detection traps, rescans, atomic claims, and idempote...
-
C# async/await Best Practices - A Decision Table for Task.Run and ConfigureAwait
A practical guide to C# async/await, organized around decision tables for I/O-bound work, CPU-bound work, Task.Run, ConfigureAwait(false), fire-and-forget, a...
-
Why a C++/CLI Wrapper Is Often the Best Way to Use a Native DLL from C# - A Practical Comparison with P/Invoke
When calling a native DLL from C#, there are cases where P/Invoke is enough and cases where a thin C++/CLI wrapper becomes the cleaner option. This article o...