dotnet-pinvoke
FeaturedCorrectly call native (C/C++) libraries from .NET using P/Invoke and LibraryImport. Covers function signatures, string marshalling, memory lifetime, SafeHandle, and cross-platform patterns. USE FOR: writing new P/Invoke or LibraryImport declarations, reviewing or debugging existing native interop code, wrapping a C or C++ library for use in .NET, diagnosing crashes, memory leaks, or corruption at the managed/native boundary. DO NOT USE FOR: COM interop, C++/CLI mixed-mode assemblies, or pure managed code with no native dependencies.
Install
Quality Score: 93/100
Skill Content
Details
- Author
- dotnet
- Repository
- dotnet/skills
- Created
- 9 months ago
- Last Updated
- today
- Language
- C#
- License
- MIT
Similar Skills
Semantically similar based on skill content — not just same category
dotnet-aot-compat
Make .NET projects compatible with Native AOT and trimming by systematically resolving IL trim/AOT analyzer warnings. USE FOR: making projects AOT-compatible, fixing trimming warnings, resolving IL warnings (IL2026, IL2070, IL2067, IL2072, IL3050), adding DynamicallyAccessedMembers annotations, enabling IsAotCompatible. DO NOT USE FOR: publishing native AOT binaries, optimizing binary size, replacing reflection-heavy libraries with alternatives. INVOKES: no tools — pure knowledge skill.
csharp-expert
C#/.NET expertise (.NET Framework 4.x to .NET 9, ASP.NET Core/MVC, EF Core/EF6/Dapper, WPF/WinForms) - idioms, async, DI, performance, security, upgrades. Use when writing, reviewing, debugging or migrating C# code or .csproj files.
dotnet-techne-csharp-coding-standards
Use when writing or refactoring modern C# with maintainability and performance standards. Keywords: coding standards, C# best practices, refactor C#, records, pattern matching, async best practices.