Take the 2-minute tour ×

I need to read a file there. I tried Assembly.ExecutingAssembly etc but that doesnt work.

share|improve this question

2 Answers 2

up vote 13 down vote accepted

From asp.net it's simple:

share|improve this answer
Except sometimes it's not. Deployed websites often have their App_Data in ~/bin/App_Data, but use ~/App_Data locally. Using the |DataDirectory| substitution is broken in these cases. See stackoverflow.com/questions/18706945/… –  Charles Burns Sep 16 '13 at 4:08

another way is:

share|improve this answer
This isn't documented on MSDN, so I would not recommend using this –  Hoppe Oct 16 at 14:03
@Hoppe But I use it and It worked for me –  mina morsali Oct 18 at 6:01

Your Answer


