简体   繁体   English

ThreadPool.QueueUserWorkItem NullReferenceException

[英]ThreadPool.QueueUserWorkItem NullReferenceException

Why I'm getting this error.为什么我会收到此错误。 My variables get the names from request, and also i tried "data.qext" but visual studio give me error.我的变量从请求中获取名称,我也尝试过“data.qext”,但 visual studio 给我错误。

I got "test.pdf" file in my WebsiteRoot/uploads/files/test.pdf, but still there is an error.我的 WebsiteRoot/uploads/files/test.pdf 中有“test.pdf”文件,但仍然有错误。 Maybe I'm missing something?也许我错过了什么?

Check image for detailed description: http://prntscr.com/7wnid详细说明查看图片: http://prntscr.com/7wnid

You can try this method instead of HttpContext.Current.Server.MapPath :您可以尝试使用此方法代替HttpContext.Current.Server.MapPath

System.Web.Hosting.HostingEnvironment.MapPath()

Doing so, there's no need for an HttpContext .这样做,就不需要HttpContext了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM