ClickOnce including files  
Author Message
rthompson





PostPosted: Wed Feb 06 01:51:08 CST 2008 Top

Visual C#.Net >> ClickOnce including files 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

DotNet224  
 
 
RobinS





PostPosted: Wed Feb 06 01:51:08 CST 2008 Top

Visual C#.Net >> ClickOnce including files 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.
-------------------------------
"walter1234" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
>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
>

 
 
walter1234





PostPosted: Wed Feb 06 07:45:03 CST 2008 Top

Visual C#.Net >> ClickOnce including files 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


"RobinS" wrote:

> 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.
> -------------------------------
> "walter1234" <EMail@HideDomain.com> wrote in message
> news:EMail@HideDomain.com...
> >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
> >
>
>