문제

I have to call my c method from c# coding.I have included .c file in our project.In c file i have test() method.I don't know how to call in c#. I don't want to convert my c project to dll file.

도움이 되었습니까?

해결책

I don't want to convert my c project to dll file.

You might not want to do that, but it's the only way. The most common solutions to your problem are:

  • Compile C code into unmanaged DLL and call it using p/invoke.
  • Compile C code into a COM server and use COM interop.
  • Wrap the C code in a C++/CLI mixed mode assembly which you can add to the C# project as a reference.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top