I need to be able to call .NET 3.5 managed code in a DLL from native C. I was not provided with .h or .lib files.
I’ve tried making a C++ DLL to expose a C-compatible interface but I don’t seem to be able to include the DLLs I need to use in my project.
Is there any way to call .NET managed code from native C?
Pure managed code will never provide you a header or library – it relies on the .NET framework’s metadata abilities instead for the compiler to determine the appropriate API.
The easiest way to use a managed assembly from C is to use C++/CLI to make a native wrapper around the managed code. You can then expose a C API from this DLL, and call into it like any other C/C++ DLL.