dotnet-expert

Guide .NET 8.0 WPF development for VoiceLite's desktop application.

12|3|Updated Sep 24, 2025
One-click install
npx skills add https://github.com/mikha08-rgb/VoiceLite --skill dotnet-expert
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-expert
Source: https://github.com/mikha08-rgb/VoiceLite/tree/main/.claude/skills/dotnet-expert
Command: npx skills add https://github.com/mikha08-rgb/VoiceLite --skill dotnet-expert

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires NAudio, H.InputSimulator, Hardcodet.NotifyIcon.Wpf, System.Text.Json, System.Management, Moq, FluentAssertions, xUnit.

What problem does it solve?

This Skill provides expert guidance for .NET 8.0 WPF development, addressing common issues like memory leaks, UI thread blocking, and incorrect async patterns, ensuring VoiceLite's desktop application is robust and performant.

Core Features & Use Cases

  • Disposal Patterns: Emphasizes correct IDisposable implementation for resources like NAudio to prevent memory leaks.
  • UI Thread Safety: Guides on using the Dispatcher for safe UI updates from background threads.
  • Async/Await Best Practices: Explains proper async void for event handlers and ConfigureAwait(false) for non-UI code to prevent deadlocks.
  • Use Case: When refactoring VoiceLite's audio recording, use this skill to ensure that WaveInEvent resources are correctly disposed using the IDisposable pattern, preventing memory leaks and ensuring application stability.

Quick Start

Review the AudioRecorder class in VoiceLite for proper IDisposable implementation to prevent memory leaks, ensuring WaveInEvent resources are correctly released.

Frequently Asked Questions about dotnet-expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent memory leaks when using NAudio for audio recording in WPF?

Implement the IDisposable pattern correctly for NAudio resources like WaveInEvent. Ensure Dispose() is called on audio objects to release unmanaged resources and prevent memory leaks in long-running WPF applications.

What's the proper way to update UI elements from background threads in WPF?

Use the Dispatcher to marshal UI updates from background threads. Call Dispatcher.Invoke() or Dispatcher.BeginInvoke() to ensure thread-safe UI modifications and prevent cross-thread access violations.

How do I use async/await correctly in WPF event handlers?

Use async void only for event handlers. For non-UI methods, return Task and use ConfigureAwait(false) to avoid deadlocks and free the UI thread. Avoid async void for regular methods.

Why does my WPF application hang when running long operations?

Long-running code on the UI thread blocks responsiveness. Use async/await with ConfigureAwait(false) or background threads via Task to keep the UI thread free for user interactions.

Can I use NAudio with .NET 8.0 WPF applications?

Yes, NAudio is compatible with .NET 8.0 WPF. Install it via NuGet and follow IDisposable patterns to properly manage audio device resources and prevent memory leaks.

What are common .NET 8.0 async/await mistakes in WPF?

Common mistakes include using async void outside event handlers, omitting ConfigureAwait(false) in library code, and blocking on Task.Result. These cause deadlocks and UI freezes in WPF applications.