Developer
Developer

Reputation: 18679

How to call a C library from .NET

I have a C library which I need to call from an ASP.NET / C# app, how do I go about doing this?

Upvotes: 0

Views: 1788

Answers (3)

Powerlord
Powerlord

Reputation: 88796

If it's a DLL, you can use P/Invoke to make function calls to it.

Upvotes: 0

Walden Leverich
Walden Leverich

Reputation: 4546

P/Invoke is your friend here, assuming you mean a true "raw" DLL, and not a COM object implemented in C.

Upvotes: 1

Dan Byström
Dan Byström

Reputation: 9244

[DllImport]

Take a look at http://pinvoke.net/ - that should get you going! Good luck.

Upvotes: 5

Related Questions