I have a class, EmailSendJob, that implements IJob and I need to get the path to the App_Data folder in my web project from the Execute(IJobExecutionContext context) method of the EmailSendJob class. Can anyone tell me how to do this?
Asked
Active
Viewed 405 times
0
Damien_The_Unbeliever
- 234,701
- 27
- 340
- 448
COBOL
- 1,031
- 8
- 16
- 32
-
possible duplicate of [Where is |DataDirectory| defined?](http://stackoverflow.com/questions/12187068/where-is-datadirectory-defined) – Erik Philips Jan 16 '15 at 07:26
-
Do you schedule this EmailSendJob from the web project? – jvilalta Feb 10 '15 at 23:20
1 Answers
1
Probably want something like:
var appDataPath = (string)AppDomain.CurrentDomain.GetData("DataDirectory");
(should work for ASP.Net or Local Applications)
Erik Philips
- 53,428
- 11
- 128
- 150