ClickOnce including files

W

walter1234

I have an application that is deployed with ClickOnce. The app has uses some
Crystal Reports files but they are not part of the application, but just
stored in a Reports directory. They are not classes within the project.

To display a report, the program
1. Gets a reference to the file from the selection in a dropdown box
2. Creates/instantiates a report document
3. Loads the the report into the document rptDoc.load(<file path>)
4. does some stuff (authentication,parameters, ect)
5. Assigns it as the ReportViewer's report source
works fine, but when I add the rpt files to the project, it wants to treat
them as reports and create a class for each with a code file.
I just need to get the report files copied to the app data directory when
the app is deployed so I don't have to rewrite all the code.
Can anyone suggest how to do this??
tia
Walter
 
R

RobinS

It sounds like it's a Visual Studio issue. When you add the files, VS treats
them as code, and you just want to include them as content, right?

Can you rename them to .txt or something like that and still use them in
your program? You could then add them to your project and mark them as
"Build Action = Content", and "Copy always".

Or you could deploy them as txt and have your app rename them when it runs
(check for all .txt files, rename).

RobinS.
GoldMail, Inc.
 
W

walter1234

Robin,
Thanks for your reply. It's good to know that that is VS intended behavior.
Now I can think of a number of ways to handle the problem.
Regards,
Walter
 

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