Click here to Skip to main content
15,905,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

Recently i came across a situation, where in I have to call C# code from C++.

After doing some research over it, I could achieve it by making C# code as DLL and then having a C++/CLI static lib, which has reference to C# DLL and then using this C++/CLI lib in my native C++ code.

But i am really doubtful, Do i really need to make a DLL and LIB to achieve this?

Is there any better way to do that?

So my question is:

1. Is it possible, if i can have C++/CLI wrapper around C# class directly under a single project? without creating a C# DLL?

Thanks in advance
Philippe Mori 16-Sep-15 12:03pm    
At least, within the IDE, you need multiple projects. And I would be surprised if it would be possible given that it is evident that both langage are mostly handled by independant teams as there are a lot of things that are done differently in refactoring, browsing or debugging.

C# and VB.NET are probably much more similar in implementation as a far as I know, this would not be possible.
Philippe Mori 16-Sep-15 12:05pm    
Even if it were possible, good separation is always a good thing in software development. however, I think it is possible to merge assembly if desired.
sourabhmehta 27-Sep-15 23:23pm    
Thanks for your response

1 solution

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900