c# - Adding a "winmd" reference vs Adding a project reference -


i have windows phone 8 project , project written in c++ ; both in same solution. c++ project dynamic library used in wp8 project, , configured produce windows metada file (.winmd) on top of .dll file.

when adding c++ project project reference in wp8 project, works well.

however, i'd reference directly binaries instead of project tried referencing .dll vs2012 not let me (which totally understand since library unmanaged understand). adding .winmd file instead works, mean compiles without warning/errors ; crashes @ runtime (i targetinvocationexception raised because "actual" code of c++ library cannot found).

when adding .winmd file, made sure .dll file next it. putting both files in bin directory of wp8 project not work either.

i can't find clues on internet , i'd grateful if give me some, hints welcome!

here schema of trivial architecture i'm trying set up:

architecture

and here stacktrace of exception raised:

at system.stubhelpers.stubhelpers.getwinrtfactoryobject(intptr pcpcmd)    @ sqlite.sqlite3.sqlite3_open_v2(string filename, database& db, int32 flags, string zvfs)    @ sqlite.sqlite3.open(string filename, database& db, int32 flags, intptr zvfs)    @ sqlite.sqliteconnection..ctor(string databasepath, sqliteopenflags openflags, boolean storedatetimeasticks)    @ sqlite.sqliteconnection..ctor(string databasepath, boolean storedatetimeasticks)    @ wp8classlibrary.somemanager..ctor(string databasepath)    @ wp8app.someviewmodel..ctor()    @ wp8app.mainpage..ctor() 

tools + options, projects , solutions, build , run. change "msbuild project build output verbosity" setting normal.

pay attention build output, messages see after "xappackager". show files getting added xap package. dll needs in list. if not program fail described. in case you'll need find out why getting skipped. start checking copy local property of .winmd reference true.


Comments