Answered by:
[UWP][C++]Consume C# from C++/CX Store apps

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!
- Edited by Xavier Xie-MSFT Sunday, August 28, 2016 3:46 AM subject
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
.
That said: yes, you can write a Windows Runtime Component in C#.
- Proposed as answer by Xavier Xie-MSFT Thursday, August 25, 2016 11:50 AM
- Marked as answer by Xavier Xie-MSFT Sunday, August 28, 2016 3:46 AM
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
- Proposed as answer by InLocoAbsentia Friday, August 19, 2016 7:38 PM
- Marked as answer by Xavier Xie-MSFT Sunday, August 28, 2016 3:46 AM
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
.
That said: yes, you can write a Windows Runtime Component in C#.
- Proposed as answer by Xavier Xie-MSFT Thursday, August 25, 2016 11:50 AM
- Marked as answer by Xavier Xie-MSFT Sunday, August 28, 2016 3:46 AM
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
- Proposed as answer by InLocoAbsentia Friday, August 19, 2016 7:38 PM
- Marked as answer by Xavier Xie-MSFT Sunday, August 28, 2016 3:46 AM
Friday, August 19, 2016 11:56 AM