An open API service indexing awesome lists of open source software.

https://github.com/asklar/winrtcomponent

How to consume C# WinRT components from C++
https://github.com/asklar/winrtcomponent

cpp csharp csharp-code dotnet dotnet-native ilc net-native uwp uwp-app uwp-applications uwp-apps uwp-dev

Last synced: 17 days ago
JSON representation

How to consume C# WinRT components from C++

Awesome Lists containing this project

README

        

# Consuming C# WinRT components from C++

This project provides a sample for how to call a C# WinRT component from a C++/WinRT UWP app.

The default out-of-the-box solution in Visual Studio is faulty in that it builds, but then fails at runtime with a cryptic exception:

```
FUSION_E_REF_DEF_MISMATCH
0x80131040 The located assembly's manifest definition does not match the assembly reference
```

Here's how to get it to work:
1. Right click on the VCXProj file ➡ Manage NuGet Packages.
2. Search for **Microsoft.Net.Native.Compiler**, and install it
3. Then add the following properties to the VCXProj
```

true
2.2.3

```
(Replace the `2.2.3` version above with the version from the .net native compiler NuGet Package)