Deploying XBAP with win32 DLL
Asked Answered
O

1

2

My XBAP application uses two win32 dlls and as usual many .Net dlls. Since we add .net references to the project itself, that is not a problem, as they all get deployed automatically when publishing the project; only that their names change from mydotnet.dll to mydotnet.dll.deploy.

But the problem is, the win32 dlls don't get deployed, neither their names change. And I understand the reason. It's because I call them using p/invoke techniques, and they're not added to the project. In fact, visual studio 2010 doesn't let me add them to the references. So I manually copied them to the publish-folder, and tried experimenting if that works. But it didn't work. The error the browser shows, is this:

System.DllNotFoundException: Unable to load DLL 'Player.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

at Player.PlayerProxy.Initialize()
atRunaware.WpfBrowserApp.Player.Page1.PlayFile(Object sender, RoutedEventArgs e)

Can anyone explain me what is going on? And any solution for that?


Previously I was trying to do what I want to do in Silverlight, but Austin suggested me to use XBAP to achieve the same thing. URL to the previous topic:

Handle to Silverlight UserControl

Overspread answered 21/1, 2011 at 12:3 Comment(1)
Does the client machine have Visual Studio runtime binaries installed? Check the dependencies of your native DLLs to see if you need to deploy anything else.Agate
T
1

Can you try:

  1. Checking your project properties under the Publish > Application Files section and if your native dlls appear there, making sure they are set to include.

  2. Try including the dlls as content files in your project with copy to output directory set to Copy Always (I would think this may make them appear in the list of references mentioned in point 1, allowing you to set them to "Include").

Trustbuster answered 21/1, 2011 at 12:22 Comment(4)
No. The native dlls don't appear there. Only .net dlls are there and their Publish Status is Include(Auto).Overspread
Right click the project and do Add Existing Item for each native dll. Then when they are added, select each one and choose Build Action as Content and Copy To Output Directory as Copy Always. They should then appear in your Application Files section of the project properties, so you can make sure they are set to Include.Trustbuster
@Jeff825: Trying to do same (XBAP with custom dll for interop with remote server, deployed using a shared public folder for now). Runs locally, but not from another machine in local network! Error is System.DllNotFoundException: Unable to load DLL (Exception 0x8007007E). Doing exactly what is said - I can see the the manifest contains dll, even the data transfer to the remote machine IE browser is larger by the size of the dll! But no go!Taffeta
I'm facing the exact same issue. Did you ever solve this?Inlaid

© 2022 - 2024 — McMap. All rights reserved.