HighTechTalks DotNet Forums  

file not found when I debug on my local system

Dotnet Framework (Compact Framework) microsoft.public.dotnet.framework.compactframework


Discuss file not found when I debug on my local system in the Dotnet Framework (Compact Framework) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Achu
 
Posts: n/a

Default file not found when I debug on my local system - 10-01-2007 , 05:28 PM






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.


Reply With Quote
  #2  
Old   
dbgrick
 
Posts: n/a

Default RE: file not found when I debug on my local system - 10-02-2007 , 08:32 AM






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

"Achu" wrote:

Quote:
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.



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.