Global.asax中使用HttpContext为空 application启动的时候并没有对应的HttpContext.Current请求所以会出错 用System.Web.Hosting.HostingEnvironment.MapPath就可以了