Calling Unmanaged C++ from C#
问题 I'm running VS2012 on Win7 with .NET 4.0. I've tried the following: Create C++ DLL project Checked\Unchecked the export symbols box I've made sure my platform targets are the same. In my case, win32 I've added the necessary extern "C" and __declspec(dllexport) where needed. I've successfully compiled my DLL and have tried to reference it in a C# project. Unfortunately, I get an error telling my it can't be added and that I need to make sure it's a valid assembly or COM object. I've given up