A text log is required in the project, and multithreading is used in order to speed up the response.
However, the previous method does not support multi-threaded, program run error.
Trace code Discovery hint HttpContext is empty.
1.httpcontext.current represents the current HttpRequest corresponding context object
HttpContext.Current change in different HttpRequest.
This means that data saved with HttpConext.current.items cannot be passed across pages.
2.httpcontext.current can only return a value from a thread that is currently executing
3.httpcontext.current
This will be related to Thread.currentcontext, when the multi-threaded switch
The httpcontext.current will be replaced with the context of the current thread.
General will use the System.Web.HttpContext.Current.Server.MapPath method, then it can not be used so it is possible to use
System.IO.Path.Combine (AppDomain.CurrentDomain.BaseDirectory, strpath);
Another is the file operation do not use static method , will cause file occupancy and so on.
The problem of httpcontext.current under multi-threading