Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't ClickOnce in Visual Studio deploy content files from dependent assemblies?

Tags:

.net

clickonce

I have a smart client application that is deployed via click once. The problem is that i have content files in dependent assemblies that just don't show up in the published application files dialog in visual studio.

This means that everytime I deploy I have to copy all the content files from the application build output directory into the published directory and rebuild the manifests which is a real pain.

Why are these files not visible to the publisher in visual studio?

like image 407
John Hunter Avatar asked Feb 26 '09 11:02

John Hunter


People also ask

How do I add files to ClickOnce deployment?

To add a file to a groupClick the Publish tab. Click the Application Files button to open the Application Files dialog box. In the Application Files dialog box, select the Group field for a file that you wish to include in the new group. In the Download Group field, select a group from the drop-down list.

Where are ClickOnce files stored?

Every ClickOnce application installed on a local computer has a data directory, stored in the user's Documents and Settings folder. Any file included in a ClickOnce application and marked as a "data" file is copied to this directory when an application is installed.

How do I publish a ClickOnce application using the Publish Wizard?

In Solution Explorer, right-click the application project and click Properties. The Project Designer appears. Click the Publish tab to open the Publish page in the Project Designer, and click the Publish Wizard button. The Publish Wizard appears.


2 Answers

I seemed to have found an evolution of the answer from @John Hunter that is much simpler, add this to the csproj.

<ItemGroup>
    <Content Include="Bin\**\*.rpt" />
</ItemGroup>

This will then make visual studio automatically view all *.rpt files in that folder as part of the solution. You could go with *.* to accumulate everything. This makes more sense if you have a container folder like bin\MyDeployables\**\*.*

We followed a similar usage for using Cassette MSBuild to combine and minifiy our JS at publish time, and be able to publish the created files through the built in VS publish tooling.

like image 73
Chris Marisic Avatar answered Oct 02 '22 20:10

Chris Marisic


I think my answer from this post answers your question.

Summary
Either...
Add your content files to your project using the "Add as link" feature.
Or...
Create a post-build event to copy your content files to the main output folder.

like image 39
codeConcussion Avatar answered Oct 02 '22 19:10

codeConcussion