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

John Hunter picture John Hunter · Feb 26, 2009 · Viewed 9.8k times · Source

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?

Answer

Chris Marisic picture Chris Marisic · Aug 30, 2012

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.