title: P/Invoke or C++/CLI for wrapping a C library
body: <p>We have a moderate size (40-odd function) C API that needs to be called from a C# project. The functions logically break up to form a few classes that will comprise the API presented to the rest of the project.</p>
  <p>Are there any objective reasons to prefer P/Invoke or C++/CLI for the interoperability underneath that API, in terms of robustness, maintainability, deployment, ...?</p>
  <p>The issues I could think of that might be, but aren't problematic are:</p>
  <ul>
  <li>C++/CLI will require a separate assembly; the P/Invoke classes can be in the main assembly. (We've already got multiple assemblies, and there'll be the C DLLs anyway, so not a major issue.)</li>
  <li>Performance doesn't seem to differ noticeably between the two methods.</li>
  </ul>
  <p>Issues that I'm not sure about are:</p>
  <ul>
  <li>My feeling is C++/CLI will be easier to debug if there's an interop problem; is this true?</li>
  <li>Language familiarity - enough people know C# and C++, but knowledge of details of C++/CLI are rarer here.</li>
  </ul>
  <p>Anything else?</p>