I have a Windows Phone 8 project and another project written in C ++; both are in the same solution. The C ++ project is the dynamic library used in the WP8 project, and it is configured to create a Windows Metada ( .winmd ) file on top of the .dll file.
When adding a C ++ project as a reference to a project in a WP8 project, everything works fine.
However, I would like to refer directly to the binaries instead of the project, so I tried to access the .dll itself, but VS2012 did not allow me (which I fully understand, since the library is unmanaged from what I understand). Adding a .winmd file instead works, I mean that it compiles without warning / errors; but it crashes at runtime (I get a TargetInvocationException that occurs because the "actual" C ++ library code was not found).
When adding the .winmd file .winmd I made sure that the .dll file is next to it. Including both files in the bin directory of the WP8 project does not work either.
I cannot find any clues on the Internet, and I would appreciate it if you could give me some clues!
Here is a diagram of the trivial architecture that I am trying to configure:

And here is the stop code of the exception raised:
at System.StubHelpers.StubHelpers.GetWinRTFactoryObject(IntPtr pCPCMD) at Sqlite.Sqlite3.sqlite3_open_v2(String filename, Database& db, Int32 flags, String zVfs) at SQLite.SQLite3.Open(String filename, Database& db, Int32 flags, IntPtr zVfs) at SQLite.SQLiteConnection..ctor(String databasePath, SQLiteOpenFlags openFlags, Boolean storeDateTimeAsTicks) at SQLite.SQLiteConnection..ctor(String databasePath, Boolean storeDateTimeAsTicks) at WP8ClassLibrary.SomeManager..ctor(String databasePath) at WP8App.SomeViewModel..ctor() at WP8App.MainPage..ctor()
Max
source share