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?
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.
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.
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.
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.
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.
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