Nop 4.2 _httpContextAccessor.HttpContext Null Referance Exception when using PictureService in a Task

Posted: June 25, 2019 at 10:48 AM Quote #239702
We have a background task that depends on _pictureService.GetPictureUrl method. In the method GetImagesPathUrl (which is called by GetThumbUrl) the _httpContextAccessor.HttpContext is NULL and throws an error. In 4.10 this method didn't exist and the shop path was handled by webHelper.GetStoreLocation(); I guess the Task doesn't have a  context, hence the exception.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: June 25, 2019 at 9:56 PM Quote #239720
Hello,

In 4.20 you can find here,

https://github.com/nopSolutions/nopCommerce/blob/develop/src/Libraries/Nop.Core/IWebHelper.cs
This post/answer is useful
-1
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
I am passionate about new ideas and new way of thinking :-)

Cheers,
Smiten Kalathiya
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.
eCommerce CONFERENCE 2019
Learn more