views:

39

answers:

1

I'm creating a .NET DLL that acts as a wrapper using PInvoke on an unmanaged DLL. My question is, if I'm PInvoking an unmanaged DLL that references other DLLs when using click once, which DLLs do I need to include with the deployment of a project that uses that .NET Wrapper DLL?

Files involved:

  • Project that uses click once deployment
  • .NET DLL that wraps unmanaged DLL (call it X.DLL)
  • X.DLL that is an unmanaged DLL
  • Y.DLL that is an unmanaged DLL called by X.DLL

Do I have to include all of these files in the click once deployment? Just the .NET DLL? Explanations of why would be helpful as well :)

+2  A: 

Yes, you have to specify all of them. Or at least make sure they're all available on the target in one way or another.

Although the .NET dll will probably be selected automatically (as part of the Project). But you have to check if the unmanaged DLLs are detected properly and otherwise add them.

If this is about /Sytem32/ DLLs or files that are otherwise shared you may have a problem. You cannot install shared DLLs with ClickOnce, so you will have to copy to local. And then hope it works.

Henk Holterman
They aren't from System32, so I need to add the .NET DLL, X, and Y all to be published? Once published to the server, how does this work? When someone installs it via clickonce does it copy the DLLs to their computer?
Jage
Had to change to unaccepted. I need a more thorough answer on how to get this working with Click Once and publishing it is not working.
Jage
@Jage, well, you can put a bounty on it.
Henk Holterman
@Henk Actually just figured it out. You have to make sure the unmanaged DLLs are in the root of the project (or the DLLImport PInvoke matches what folder you're putting it in from the root project folder) and you have to set the file's properties Build Action to Content and Copy To Output Directory as Copy Always or Copy If Newer. I'll go ahead and accept your answer again since it was close enough I guess.
Jage