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?
Select the Publish pane. Click the Prerequisites button to open the Prerequisites dialog box. In the Prerequisites dialog box, make sure that the Create setup program to install prerequisite components check box is selected. In the Prerequisites list, check the components that you wish to install, and then click OK.
In the Specific target page, select ClickOnce. Enter a path or select Browse to select the publish location. In the Install location page, select where users will install the application from. In the Settings page, you can provide the settings necessary for ClickOnce.
Click the Publish tab. Click the Updates button to open the Application Updates dialog box. In the Application Updates dialog box, make sure that the check box The application should check for updates is selected. In the Choose when the application should check for updates section, select After the application starts.
On the File menu, click Open to open your application manifest. Select the Files tab. In the text box at the top of the tab, enter the directory that contains your application's files, and then click Populate. Your data file will appear in the grid.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With