Dotnet Pinvoke

by dotnet0608d8924cd3MIT5.5K starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated today

Correctly 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.

Instructions only

Only the file list is public. File contents are available once the skill is installed in a workspace.

PathSizeType
references/diagnostics.md3.6 KBtext/markdown
references/type-mapping.md3 KBtext/markdown
SKILL.md18.9 KBtext/markdown

Source and attribution

Source:dotnet/skillsinplugins/dotnet-advanced/skills/dotnet-pinvokeat commit0608d89

License: MIT

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal