tags:

views:

847

answers:

3

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?

A: 

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.

whatknott
I tried all that and it doesn't work for me. The content files from the dependent assemblies are already in the output folder but they do not show up in the application files dialog even if I select show all files. Is there something else i am missing here?
John Hunter
what, specifically, are your "content files"? what file extension do they have?
whatknott
.rpt for crystal report files mostly.
John Hunter
+1  A: 

Ok I still don't know why Visual studio cannot display referenced content files with its publish ui but I found a work around to force the publish to include these files.

Put this in the project file.

<ItemGroup>
<AdditionalPublishFile Include="$(OutputPath)\**\*.rpt">
  <Visible>False</Visible>
</AdditionalPublishFile>
</ItemGroup>
<Target Name="BeforePublish">
  <Touch Files="@(IntermediateAssembly)" />
  <CreateItem Include="@(AdditionalPublishFile)" AdditionalMetadata="TargetPath=%(RecursiveDir)%(Filename)%(extension);IsDataFile=false">
    <Output TaskParameter="Include" ItemName="_DeploymentManifestFiles" />
  </CreateItem>
</Target>
John Hunter
A: 

I assume this solution was based on: http://blogs.msdn.com/mwade/archive/2008/06/29/how-to-publish-files-which-are-not-in-the-project.aspx

As per my recent comment on the post:

At what point should we expect these to appear in the "Application Files" listings (if at all)?

Or is safe to assume they'll end up in our deployed data files listing?

In my case I'm hoping to use:

False

To include all content files from dependent assemblies that are within the "Resources" subfolder of the build directory.

Andrew.

Reddog