file not found when I debug on my local system

  • Thread starter Thread starter Achu
  • Start date Start date
A

Achu

I am trying to load a text file but i could not find the file when i
debug the application. the text file "a.txt" is created in the same
folder where my application (exe) is launched.

Assembly asm = Assembly.GetExecutingAssembly();
MyFile = Path.GetDirectoryName(asm.GetName().CodeBase) + "\
\a.txt";


MyFile is return "\\Program Files\\Application1\\a.txt"; so where is
\\Program Files\\ on my location windows machine (its for debug, not
in the real system). How do i setup path for testing on my local
system.


Thanks for your help.

Achu.
 
If you created the text file in Visual Studios, then you need to deploy the
file to the emulator. To do that, Select the file, change the properties to
Content and Copy if newer. This will ensure the file is deployed. As per
the directory. This is the local directory of the device (either a real
device or the emulator. You can browse to the directory using the emulators
file explorer. This does not directly map to the directory on your local
box, but is referenced to the emulators directory structure.

Regards,
Rick D.
Contractor
 
Back
Top