Let me preface this by saying I've been primarily an ASP.Net developer
over the last few years and have just started working with Winforms.

My application will be a standalone program that will access FoxPro
database files. A typical installation would install my exe in
C:\Program Files\My Company\My Application. I want my database files to
go in C:\Program Files\My Company\My Application\Data. I've added the
Data folder to my project and selected the build action as content for
each Foxpro item inside it.

My question is with determining the path to the database files for my
connection string. I'll be able to determine the Data folder path using
Application.StartupPath. However, when debugging, the exe is compiled
and executed from the bin folder. Thus, the database path is incorrect
when using Application.StartupPath.

How can I simulate the install structure when developing and debugging?

Re: Deployment/Debugging Question by Bryan

Bryan
Thu Oct 19 01:25:57 CDT 2006

If the data files are not that large, you could add them to the project
and specify "Copy Always" or "Copy If Newer" in the Copy to Output
Directory dropdown.

Bryan Phillips
MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com




"daokfella" <jjbutera@hotmail.com> wrote in message
news:1161180663.107911.326930@e3g2000cwe.googlegroups.com:

> Let me preface this by saying I've been primarily an ASP.Net developer
> over the last few years and have just started working with Winforms.
>
> My application will be a standalone program that will access FoxPro
> database files. A typical installation would install my exe in
> C:\Program Files\My Company\My Application. I want my database files to
> go in C:\Program Files\My Company\My Application\Data. I've added the
> Data folder to my project and selected the build action as content for
> each Foxpro item inside it.
>
> My question is with determining the path to the database files for my
> connection string. I'll be able to determine the Data folder path using
> Application.StartupPath. However, when debugging, the exe is compiled
> and executed from the bin folder. Thus, the database path is incorrect
> when using Application.StartupPath.
>
> How can I simulate the install structure when developing and debugging?


Re: Deployment/Debugging Question by daokfella

daokfella
Thu Oct 19 15:19:06 CDT 2006

Is that a VS 2005 feature? I'm using VS.Net 2003.

Bryan Phillips wrote:
> If the data files are not that large, you could add them to the project
> and specify "Copy Always" or "Copy If Newer" in the Copy to Output
> Directory dropdown.
>
> Bryan Phillips
> MCSD, MCDBA, MCSE
> Blog: http://bphillips76.spaces.live.com
>
>
>
>
> "daokfella" <jjbutera@hotmail.com> wrote in message
> news:1161180663.107911.326930@e3g2000cwe.googlegroups.com:
>
> > Let me preface this by saying I've been primarily an ASP.Net developer
> > over the last few years and have just started working with Winforms.
> >
> > My application will be a standalone program that will access FoxPro
> > database files. A typical installation would install my exe in
> > C:\Program Files\My Company\My Application. I want my database files to
> > go in C:\Program Files\My Company\My Application\Data. I've added the
> > Data folder to my project and selected the build action as content for
> > each Foxpro item inside it.
> >
> > My question is with determining the path to the database files for my
> > connection string. I'll be able to determine the Data folder path using
> > Application.StartupPath. However, when debugging, the exe is compiled
> > and executed from the bin folder. Thus, the database path is incorrect
> > when using Application.StartupPath.
> >
> > How can I simulate the install structure when developing and debugging?


Re: Deployment/Debugging Question by daokfella

daokfella
Thu Oct 19 15:44:11 CDT 2006

I've gone ahead and used
#If DEBUG Then
' Path relative to bin directory
#Else
' Path relative to project root
#End If

Bryan Phillips wrote:
> If the data files are not that large, you could add them to the project
> and specify "Copy Always" or "Copy If Newer" in the Copy to Output
> Directory dropdown.
>
> Bryan Phillips
> MCSD, MCDBA, MCSE
> Blog: http://bphillips76.spaces.live.com
>
>
>
>
> "daokfella" <jjbutera@hotmail.com> wrote in message
> news:1161180663.107911.326930@e3g2000cwe.googlegroups.com:
>
> > Let me preface this by saying I've been primarily an ASP.Net developer
> > over the last few years and have just started working with Winforms.
> >
> > My application will be a standalone program that will access FoxPro
> > database files. A typical installation would install my exe in
> > C:\Program Files\My Company\My Application. I want my database files to
> > go in C:\Program Files\My Company\My Application\Data. I've added the
> > Data folder to my project and selected the build action as content for
> > each Foxpro item inside it.
> >
> > My question is with determining the path to the database files for my
> > connection string. I'll be able to determine the Data folder path using
> > Application.StartupPath. However, when debugging, the exe is compiled
> > and executed from the bin folder. Thus, the database path is incorrect
> > when using Application.StartupPath.
> >
> > How can I simulate the install structure when developing and debugging?