Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for C# WinRT/components in C++ applications #45

Open
ocalvo opened this issue Jun 4, 2021 · 2 comments
Open

Add support for C# WinRT/components in C++ applications #45

ocalvo opened this issue Jun 4, 2021 · 2 comments

Comments

@ocalvo
Copy link
Collaborator

ocalvo commented Jun 4, 2021

In order to support this scenario we may need to support .NET Core 5 or .NET Core 6

@kmelmon
Copy link
Collaborator

kmelmon commented Jun 4, 2021

See #38 which changed the NativeXamlIslands sample from a mixed C++/C# app to just straight C++. As a starting point, we can try to get the version of this project from just before the PR working.

More context on the issue we faced with this version:

The project builds but when deploying to a clean machine without Visual Studio installed, you'll see this error:
Windows cannot install package 99def245-f2b3-46c8-9d9d-2f4780e9e424_1.0.17.0_x64__gw2qmfeskbexa because this package depends on a framework that could not be found. Provide the framework "Microsoft.NET.CoreRuntime.1.1" published by "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US", with neutral or x64 processor architecture and minimum version 1.1.27004.0, along with this package to install. The frameworks with name "Microsoft.NET.CoreRuntime.1.1" currently installed are: {}

The issue here is that the ".net UWP" package needs to be installed. This package is not the same as .NET Core 3... it's a special version of .net that supports UWP apps, and relies on .net native.

Some links with context on this:

Authoring a C# Windows Runtime component for use from a C++/WinRT app - UWP applications | Microsoft Docs
Error 0x80131040 "The located assembly's manifest definition does not match the assembly reference" when I use a Windows Runtime class written in C# from my C++/WinRT project | The Old New Thing (microsoft.com)
asklar/WinRTComponent: How to consume C# WinRT components from C++ (github.com)
Building C++/WinRT apps that consume C# components | a.rcad.io

@asklar
Copy link
Member

asklar commented Jun 4, 2021

FYI @tommcdon @SvetBonev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants