Question

In my application, I load some assemblies dynamically, depending on what was the user's choice. Naturally, these are not referenced in the project. When publishing with ClickOnce, these assemblies are not included in the package.

The question is - is it possible to trick the ClickOnce publisher to use some other files not referenced in the project?

Was it helpful?

Solution

I assume you are using Visual Studio to publish the deployment.

If you want to continue this way, you will either have to add the files as references, or add them as content to the project. Under the properties of the start-up project, go to the publish tab, Application Files.., and make sure the file is included.

Your other option is to build and publish the click-once manifests outside of Visual Studio using mageui.exe (or mage.exe if you want to work from the command line).

OTHER TIPS

You maybe don´t reference the assembly because you don't want to get deployed by ClickOnce, and get downdloaded later dynamically. But you don't have to do it. Reference normally.

There is a way to load dynamically an assembly that is described here: http://msdn.microsoft.com/en-us/library/ak58kz04.aspx

The problem is that is a manual method, using mage/MageUI to mark as optional. You can do it in Visual Studio in Project Properties / Publish / Application Files, and in the row of the assembly you want to download programmatically change the Download Group by the name you want. In the example of the link create new with name "ClickOnceLibrary".

An alternative to MageUI is ManifestManagerUtility for ClickOnce.

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