Answered by:
Unable to load dll in windows store application

Question
-
hi,
i have placed a dll in my bin/debug folder in my windows store application. and i have written following code to load my dll
[DllImport(@"DemoAPIWrapper.dll", CharSet = CharSet.Unicode)]
private extern static bool SetInputMgrConfig();but i got error like
System.DllNotFoundException: Unable to load DLL 'DemoAPIWrapper.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
can you please help me how to load that dll
thanks, prathap If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
Friday, January 25, 2013 6:49 AM
Answers
-
In the properties for the DLL where you set the "Build Action" to Content also set the "Copy to Output Directory" property to "Copy Always" or "Copy if Newer". See http://msdn.microsoft.com/en-us/library/0c6xyb66.aspx for more details.
--Rob
- Proposed as answer by Jesse Jiang Monday, January 28, 2013 7:05 AM
- Marked as answer by Jesse Jiang Wednesday, January 30, 2013 7:28 AM
Friday, January 25, 2013 10:50 PMModerator
All replies
-
Are you including the DLL in your appx package? That is required for the app to be able to find it.
Make sure your DLL is flagged as Content and marked to copy into the appx package.
--Rob
Friday, January 25, 2013 7:53 AMModerator -
hi rob,
i have placed dll in appx folder then how to flag it as Content?
thanks, prathap If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
Friday, January 25, 2013 8:38 AM -
In the properties for the DLL where you set the "Build Action" to Content also set the "Copy to Output Directory" property to "Copy Always" or "Copy if Newer". See http://msdn.microsoft.com/en-us/library/0c6xyb66.aspx for more details.
--Rob
- Proposed as answer by Jesse Jiang Monday, January 28, 2013 7:05 AM
- Marked as answer by Jesse Jiang Wednesday, January 30, 2013 7:28 AM
Friday, January 25, 2013 10:50 PMModerator