Skip to content
D

dotnet-pinvoke

Correctly call native (C/C++) libraries from .NET

by dotnetFree

#4307in AI Skills
0In stores

Description

dotnet-pinvoke is an agent skill for calling native C and C++ libraries from .NET using P/Invoke. It covers both DllImport, which dates from…

Highlights

  • Writes DllImport and LibraryImport declarations from C headers
  • Reviews signatures for type sizes, calling conventions and string encoding
  • Guides memory lifetime for native buffers and handles
  • Helps migrate DllImport to LibraryImport for AOT

Ratings & Reviews

No ratings yet

Be the first to rate dotnet-pinvoke.

People also visit

D

dart-setup-ffi-assets

Guides agents in compiling and packaging C/C++ source code into dynamic or

AI Skills
Get
D

dotnet-skills

.NET skills and sub-agents for developer workflows

AI Skills
Get
D

dart-use-ffigen

Guide agents to use `package:ffigen`

AI Skills
Get
D

detect-static-dependencies

ACTIVATION PREREQUISITE: the request or discovered target must explicitly

AI Skills
Get
C

csharp-scripts

Run file-based C# apps with the .NET CLI

AI Skills
Get
D

dump-collect

Configure and collect crash dumps for modern .NET applications

AI Skills
Get

dotnet-pinvoke FAQ

What does this skill help with?

Native interop in .NET: writing and reviewing P/Invoke signatures, marshalling strings, managing native memory, wrapping C libraries, and debugging crashes at the native boundary.

DllImport or LibraryImport?

Use DllImport when targeting .NET Framework. For .NET 7 and later, LibraryImport is preferred for new code, and it is the only option when Native AOT is required.

Which errors does it help diagnose?

AccessViolationException, DllNotFoundException, silent data corruption, and memory leaks or heap corruption involving native handles or buffers.

How do I install it?

Run npx skills add https://github.com/dotnet/skills --skill dotnet-pinvoke in your project.

What security audits has it passed?

Gen Agent Trust Hub: Pass. Socket: Pass. Snyk: Pass.

What are the best dotnet-pinvoke alternatives?

Popular alternatives to dotnet-pinvoke include dart-setup-ffi-assets, dotnet-skills and dart-use-ffigen. See all dotnet-pinvoke alternatives

Developer Stuff

Badges