I have a SignalR hub. When the client disconnects, I want to perform a file operation.
To do that, I need to access the Server.MapPath
.
However, as my Hub class is not an .aspx or a Web Service, there is no HttpContext
nor request.
I thought of delegating the IO work to the HTTP request handler, but I can not create a WebRequest with a relative URI and I need to be able to deploy the solution in various locations.
How can I be able to get the local path to use in System.IO
classes from a SignalR?
System.IO.Directory.GetCurrentDirectory()
gives me the location of the IIS worker process.