locked
[UWP][C++]Consume C# from C++/CX Store apps RRS feed

  • Question

  • Hi team,

    Is there a way to consume C# lib in a C++/CX Windows store/UWP app? if yes, can you please share your thoughts on how to achieve it?

    Thanks!


    Wednesday, August 17, 2016 1:48 AM

Answers

  • What type of app are you writing?

    As you've been asked several times before, please title your post per Guide to posting: subject line tags Alert me.

    That said: yes, you can write a Windows Runtime Component in C#.

    Wednesday, August 17, 2016 1:58 AM
  • Apologies, just went through guidelines, will title it properly.

    We've a C++/CX based store app and we're converting it to a UWP app.

    We thought it'd be great if we can use C# libs and consume them from our C++/CX app. That said, I see we've 2 options.

    1. Class lib template

    2. WinRT component

    I believe if we write a WinRT component, we can use it our app (irrespective of the programming language that it's built with).

    Is that correct?

    thanks!

    Yes. Your c++/CX UWP app could add C# windows runtime component reference.

    See this document for details: https://msdn.microsoft.com/en-us/windows/uwp/winrt-components/creating-windows-runtime-components-in-csharp-and-visual-basic

    Friday, August 19, 2016 11:56 AM

All replies

  • What type of app are you writing?

    As you've been asked several times before, please title your post per Guide to posting: subject line tags Alert me.

    That said: yes, you can write a Windows Runtime Component in C#.

    Wednesday, August 17, 2016 1:58 AM
  • Apologies, just went through guidelines, will title it properly.

    We've a C++/CX based store app and we're converting it to a UWP app.

    We thought it'd be great if we can use C# libs and consume them from our C++/CX app. That said, I see we've 2 options.

    1. Class lib template

    2. WinRT component

    I believe if we write a WinRT component, we can use it our app (irrespective of the programming language that it's built with).

    Is that correct?

    thanks!

    Wednesday, August 17, 2016 2:12 AM
  • Apologies, just went through guidelines, will title it properly.

    We've a C++/CX based store app and we're converting it to a UWP app.

    We thought it'd be great if we can use C# libs and consume them from our C++/CX app. That said, I see we've 2 options.

    1. Class lib template

    2. WinRT component

    I believe if we write a WinRT component, we can use it our app (irrespective of the programming language that it's built with).

    Is that correct?

    thanks!

    Yes. Your c++/CX UWP app could add C# windows runtime component reference.

    See this document for details: https://msdn.microsoft.com/en-us/windows/uwp/winrt-components/creating-windows-runtime-components-in-csharp-and-visual-basic

    Friday, August 19, 2016 11:56 AM