How can I compile C code for use in .NET?
There is a game that written in C; how can I convert it to .Net code or use some parts of it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t use C code directly within .NET.
You have a couple of options:
Compile the C code into a dynamic link library, and use P/Invoke in order to call it from your .NET program.
Port the C code to .NET.
Wrap the C code using C++/CLI (making a mixed mode assembly), and use these from within your other .NET language of choice.