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++
- Host: GitHub
- URL: https://github.com/asklar/winrtcomponent
- Owner: asklar
- License: mit
- Created: 2020-04-18T05:13:00.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-23T04:12:31.000Z (about 5 years ago)
- Last Synced: 2025-03-29T08:43:44.512Z (about 1 month ago)
- Topics: cpp, csharp, csharp-code, dotnet, dotnet-native, ilc, net-native, uwp, uwp-app, uwp-applications, uwp-apps, uwp-dev
- Language: C++
- Homepage:
- Size: 33.2 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)