Search code examples
c#c++dllwin-universal-appportable-class-library

How can I create a dll that can be used for both c++ and c#?


I need to develop a library that can be used for both c++ application and also by c# universal store app.
My research so far:

  • Developing in c++ wont help because c# uwp will only accept PCL.

  • Developing as PCL in c# cannot be added to c++ applications.

(I am not sure about the second case. Correct me if I am wrong.)
Is there way to developing a common library ? or I have to develop it in those two platforms separately.


Solution

  • If you create a C++ library, you can use it from C++ (obviously) and you can create a C++/CX wrapper for this C++ library that can be used from C#.