Question

My program must integrate with some third party application deployed through ClickOnce. To facilitate the process, the maker of that application provides a .NET DLL that I can reference in my program. That DLL is shipped with their application and is located in the same folder as their executable. If I understand correctly, there is no way to predict where a ClickOnce application will be installed. What would be the best strategy to link that DLL at runtime if I don't know in advance in which folder it will be located?

Was it helpful?

Solution

One solution is to have the vendor create a registry key either during installation or on-first-startup that points to the current app location. I know it's not pretty but it's a solid method to ensure you can locate the app and updates don't leave you pointing to a non-existent app.

I use this method with my click-once deployment to point to both the app directory and the data directory.

Just thought of another optoin... Could you get the dll directly from the deployment point? My click-once deployment point has the .application file along with all the assemblies. The problem here is that you need to know the latest version to find the correct assembly.

Good luck.

OTHER TIPS

In your EXE project for ClickOnce,

1) Add this DLL as "Content" (You set this in the build type). 2) In the "Application Files..." for Click Once, locate the entry for the newly added DLL add set the Publish Status to "Include" and not "Include (Auto)".

The next time you publish the click once, the DLL will be placed in the same folder as your EXE.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top