ClickOnce Content Files

D

DCDev

I have a solution with multiple projects. One project is a
windows forms project. I have report files (.rdlc) in a separate
project that are built as "Content" with the "Copy Always" option.
When I build the solution, these files are copied to the bin\Release
directory, as they should be. However, when I publish the Windows
Forms project, these content files are not copied. How can I make it
so that these content files from the one project are published along
with the windows forms project.

They are not listed in the "Applications Files" section of the
publish settings.

Thank you...
 
M

Mark S. Milley, MCSD (BinarySwitch)

Hi -

I know this is a bit backwards, but have you tried adding them as a
resource?

BTW, unless you really need it, and/or have a very small application
that is going to be updated frequently, in my experience I have found
that it's better to stay away from ClickOnce; it adds too many
additional factors to the equation. I have a lot of complaints about
how Click Once works (or doesn't work, IMHO)--the foremost being, why
did MS make the install directory completely different, not to mention
unpredictable, thereby veering away from it's own standard?
(primarydrive:\program files\vendor\application) Installing an
application into the Documents and Settings folders is just completely
against everything that they have been doing since 95...

Good Luck,

-Mark
 
R

RobinS

Are the files in the same folder as the project? Try putting them in a
subfolder under the project, and then publishing them. If you have them
marked as content, with Copy Always, it will put them in subfolder with the
same name in the bin\Release\ folder.

My company is successfully using ClickOnce to deploy its application, and
we include a lot of files this way w/no problem.

The only difference I see is that ours are in a folder under the project
that is the main UI. So you might need to move them over there if the above
doesn't work.

Robin S.
 
D

DCDev

That's what I ended up doing. I moved them into the main project.
This may cause some issues down the road because I wanted to use these
reports in two separate projects (that's why I had the reports in
their own project, so it could be used by two other projects). Now,
with this approach, I'll have to duplicate the reports in each of the
"main" projects. I don't understand why you can build an entire
solution but only publish individual projects.

Thank you all for your responses.
 
G

Guest

Wow. I did a search on "ClickOnce" and the first article that came up (this
one) is the one that applies to me.

In my case, I have Reports Project that uses Crystal Reports which are not
getting included in the installation.

I'm praying there is a better solution out there than the ones suggested. I
don't want to retool the app by putting them in a resource file...nor would I
want to duplicate the reports in the projects just so the ClickOnce will
include them.

Can someone please enlighten me on a better way to include important files
from dependent projects?
 
R

RobinS

YOu could also include them as Data files, which there's a special folders
path to get to -- it copies them to the DataDirectory each time you install
it. And if the data files don't change, when the user picks up incremental
updates, it will copy the old files forward to the new version. If the
files DO change, it makes the old ones available (I think it copies them
forward into a .\pre folder or something like that -- let me know if you
really want to know, and I'll look it up) and you can programmatically
access the old versions if you need to. This is how you could deploy
SQLServer CE database, for example. You would have migration code that is
run when the application updates its version that copies data from the old
database to the new one.

There is an excellent book on ClickOnce by Brian Noyes. It helped me
immensely -- it covers everything from including files to security to
certificates to including prerequisites with the Bootstrapper. Very
helpful.

Robin S.
--------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top