Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying Content file from dependent assemblies with ClickOnce

Tags:

clickonce

I have a simple WinForms app that I am deploying internally using ClickOnce. The main application has a dependent assembly, that assembly has some xml template files marked as "Content" and "Copy Always" in the build properties, however they do not show up in the list of Application Files if I go into the Project Properties->Publish->Application Files dialog.

Anyone know how I can deploy these Xml files that are part of a dependent assembly.

@codeConcussion- Thanks, that worked great. In the end I added the xml file using a Add Existing File and selected 'Add as Link', which accomplished the same thing.

like image 813
Nic Strong Avatar asked Jan 08 '09 03:01

Nic Strong


People also ask

How do I add files to ClickOnce deployment?

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.

Is ClickOnce still supported?

ClickOnce and DirectInvoke in Microsoft Edge | Microsoft Learn. This browser is no longer supported. Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

How do I publish with ClickOnce?

Publishing with ClickOnce. In Solution Explorer, right-click the project and choose Publish (or use the Build > Publish menu item).

What is ClickOnce deployment?

ClickOnce is a deployment technology that enables you to create self-updating Windows-based applications that can be installed and run with minimal user interaction.


1 Answers

I'm using VS 2008 SP1, so I'm not sure this will work exactly the same for previous VS versions.

You can take care of your problem by simply adding a post-build event to your main project. In a VB.Net project that would be My Project > Compile Tab > Build Events... > Edit Post Build.... In C#, Project Properities > Build Events > Edit Post-build.... A simple xcopy [source file] [destination folder] command to copy the xml template file from the dependent assembly's bin folder to the main project's bin folder should work.

From there, just make sure you check "Show all files" in the Application Files dialog of the Publish tab.

An alternative to this would be to change your two projects to build to the same bin folder. That works great but I would only do it if the dependent assembly is specific to this application and isn't a library assembly used by multiple apps.

like image 72
codeConcussion Avatar answered Sep 18 '22 13:09

codeConcussion