I figured out the issue after re-reading the tutorial. In a note box it says to "On the New Universal Windows Platform Project dialog box, choose Windows 10 Creators Update (10.0; Build 15063) as the Minimum Version.", I didn't think this was necessary as i was targeting a higher minimum version. Now i wonder why needing support for a lower version would be necessary, as newer version should include everything that is in the previous?
C++/WinRT Problems Calling C#/WinRT Method
I was following the tutorial Authoring a C# Windows Runtime component for use from a C++/WinRT app, it compiles correctly with no issues, but before the program properly initializes it crashes.
The exception thrown is "Microsoft C++ exception: winrt::hresult_error at memory location", the hresult value upon the debugger break, is "0x80131040 : The located assembly's manifest definition does not match the assembly reference."
I checked the Nuget packages to make sure they are all up to date, as well as visual studio itself. Both the UWP and the WinRT project are targeting the same windows version, so i'm out of ideas on how to resolve this issue.
This issue only occurs when i have the line"winrt::SampleComponent::Example myExample;" in my header file. As mentioned before, everything is seemingly fine at compile time, with the c# namespace and class being recognized, it's just when the program opens things go wrong.