System.BadImageFormatException when calling Windows Phone component library written in C++ RRS feed

  • Question

  • I have a build a Windows Phone component using the WinRT API in C++. I'm using it in a C# XAML phone app. The application builds and links just fine. When I try to run it in the emulator it crashes with a System.BadImageFormatException error. The application is configured for x86 and the component library is set to Win32.

    How can I resolve generating this exception?

    Saturday, March 15, 2014 2:27 AM


  • I figured it out. Apparently it does not work well to mix namespaces in a linked C++ component DLL. Everything worked fine once I changed all my CPP code to be in the same namespace. I haven't the slightest idea why having different namespaces in a component library would cause this issue.
    Monday, March 17, 2014 1:09 AM