0

My Console project has a directory named "DB".The directory only contains one file named "Northwind.mdb".

When I used vs2008 to debug/build the project,the file was always copyed to the following place:

E:\CSharp\ConsoleApp_ZhongCong\ConsoleApp_ZhongCong\bin\Debug\DB.

How can I let the database file copy to the root directory of the Application automatically instead of the "...bin\Debug\DB\" directory?

I hope to get your answers. Thanks!

senthilkumar2185
  • 2,536
  • 3
  • 22
  • 36
CongZhong
  • 1
  • 1
  • Don't you mean you want it in `\bin\Debug` as that would be the root directory of the application? Or do you mean you want it in the project folder? – ProgrammingLlama Jun 10 '18 at 10:01
  • When you run your desktop application inside Visual Studio, the startup directory of your application is \bin\debug. So it is technically correct to use that folder as "root" directory of your application. Outside the Visual Studio debug session the "root" directory of your application is wherever you put your main executable. Could you explain what is the problem for you with this copying? – Steve Jun 10 '18 at 10:04
  • https://stackoverflow.com/questions/1495504/get-current-application-physical-path-within-application-start/17749921#17749921 – senthilkumar2185 Jun 10 '18 at 10:06

0 Answers0