Question: i have some files located in 

c:\MyApp\file.txt

and current executing assenbly in in debud filder

c:\MyApp\bin\Debug\

i want to get address of above "file.txt" at run time..

i tried this

Assembly.GetExecutingAssembly().Location

it gives me 
c:\MyApp\bin\Debug\MyApp.exe

how can i get address of "file.txt"

Answer: 
The "Debug" folder (and the "Release" folder) are the actual output from your project's build. If you haven't included `file.txt` in the project and marked it as "Copy to Output Directory", then it doesn't count as part of the build output, and your app shouldn't try to load it.

Basically, just set "Copy to Output Directory" to "Copy always" or "Copy if newer", and continue to use the path `"file.txt"`
You can't, since the file and the compiled application have no relation. What if you moved the MyApp.exe somewhere else?

You have 2 options: 

1. Include file.txt in your project as a content file (it will be included in the output and in the same folder as MyApp.exe)
2. Use configuration - allow a user option to define where to find the file. You can use AppSettings for this, for example.

Well, technically you can, since you can always navigate to the parent of the current directory ("MyAppPath\.."), but that's really just a bad idea...