tags:

views:

581

answers:

1

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.

Thanks, Nic

@whatknott - 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.

+1  A: 

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.

whatknott