I am trying to add a C++ DLL to Windows Phone 8 framework in Visual Studio Express 2012.

I have tried following ways

  1. Import and invoke through PInvoke

    [DllImport("WP8DLL.dll", CallingConvention = CallingConvention.Cdecl)]

    public static extern int functionReturningInteger();

    Result: This way though there were no compile errors, but when I try to access the method of the DLL it throws System.NotSupportedException.

  2. Adding reference in the project properties

    Result: I get the message "A reference to a higher version or incompatible assembly cannot be added to the project"

Edit
Report