What works > Library setup
I have a Windows Phone 8 solution with 2 projects:
- "Hello", a simple library project -> generates Hello.dll.
- "HelloNativeRT", a WP Runtime Component with C++ files -> generates HelloNativeRT.dll and HelloNativeRT.winmd
In this solution, the "Hello" library references the WP Runtime Component, so calls like...
HelloNativeRT.SampleNamespace test = new HelloNativeRT.SampleNamespace();
...work fine in this library project.
What doesn't work > WP8 app setup
However, I want to use these two libraries in a Windows Phone 8 app, but without adding references to the projects, since I need to ship the compiled libraries to clients.
- I referenced the Hello.dll file in the project, as well as the HelloNativeRT.winmd file.
- When I launch the application in debug mode, and goes to the line
HelloNativeRT.SampleNamespace test = new HelloNative...
it crashes and says "TypeLoadException", like it cannot load the native module.
I suppose I need to include the HelloNativeRT.dll file in a way or another, since I guess it contains the native (compiled) code, as the winmd file may only embed the C++/CX code.
How should I setup my project to include this DLL?
I tried to put it at the root of the WP8 project, to reference it, to embed it... with no luck.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…