S
Sakharam
Hi All,
I am developing a scheduler object for my web application. I am starting new
thread on Application_Start event.
Everything works fine except following issue.
I am using following statement in it to get physical path of file.
strTemplateFile =
System.Web.HttpContext.Current.Server.MapPath("myFile.txt")
But, Since thread is not running against any request, I can't get
HttpContent.Current object and it throws NullReference Exception.
When I start scheduler from web page it works fine.
Can anyone guide me how to achieve this when code runs on Application_start
event not against any request.
Any help will be appreciated.
Thanks and Regards,
Sakharam Phapale
I am developing a scheduler object for my web application. I am starting new
thread on Application_Start event.
Everything works fine except following issue.
I am using following statement in it to get physical path of file.
strTemplateFile =
System.Web.HttpContext.Current.Server.MapPath("myFile.txt")
But, Since thread is not running against any request, I can't get
HttpContent.Current object and it throws NullReference Exception.
When I start scheduler from web page it works fine.
Can anyone guide me how to achieve this when code runs on Application_start
event not against any request.
Any help will be appreciated.
Thanks and Regards,
Sakharam Phapale