AppPath Please Help!!!

  • Thread starter Thread starter ruben
  • Start date Start date
R

ruben

I'm using windows forms and I have and structure of directoy like this

Folder Reports
|-----------Report1.rpt
Form1.vb
Form2.vb

If I use the Form1.vb for view the Report1.rpt the
Application.StartupPath \ "Report1.rpt" its doesn't work, because
Application.StartupPath show me ....\bin\Debug, How can I refer the
correct path for the structure that I have?

Thank you.
 
If you're using VS2005, try setting copy Copy to output folder for the
build action of Report1.rpt
 
I'm using windows forms and I have and structure of directoy like this

Folder Reports
|-----------Report1.rpt
Form1.vb
Form2.vb

If I use the Form1.vb for view the Report1.rpt the
Application.StartupPath \ "Report1.rpt" its doesn't work, because
Application.StartupPath show me ....\bin\Debug, How can I refer the
correct path for the structure that I have?

Thank you.

Use this:
new DirectoryInfo(Application.StartupPath).Parent.Parent.FullName +
"\\Folder Reports\\Report1.rpt"
 
Ruben,

This won't be your deployment structure I guess. If you try to fix the
problem by composing some strange paths like - go to filders down and then
The report folder, I doubt it this will be the configuration you are going
to have after deployoment.

If you use VB2005 you can set projects PostBuild event (this is part of the
project configuration) where you can create your real structure by create
folders and copy files in the project output directory.
 
Back
Top