I have an ASP.NET MVC 4 applicaton.
Also I have a XML file located on the root of my application.
Whenever administrator changes this file, I want the applicaton know about it and read the new values.
...
FileSystemWatcher Watcher = new FileSystemWatcher();
Watcher.Changed += new FileSystemEventHandler(OnChanged);
...
private void OnChanged(object source, FileSystemEventArgs e) {
var path = HttpContext.Current.Server.MapPath("~/"))
}
Every time HttpContext.Current
seems to be null. How to get the root folder of my application, if this does not work?