ThinkGeo.com    |     Documentation    |     Premium Support

Hangfire and MVC Edition

We are currently using the MVC Edition to generate map bitmap images that we include in pdf reports. We use the ThinkGeo.MapSuite.MvcEdition.Map instance for generating our maps and use the GetBitmap method to generate the images for our reports. This works great, however; we are working on offloading our report processing/generation to Hangfire. Our issue is that in the Hangfire service thread the HttpContext does not exist. There appears to be a hard dependency on the existence of HttpContext when calling the ThinkGeo.MapSuite.MvcEdition.Map constructor. When we call the constructor it returns a null reference exception.

Is there any way around this that will allow us to create a Map instance and execute GetBitmap without having HttpContext available?

Thanks
Greg

Hi Greg,

I think for MVC edition we cannot avoid to use HttpContext, maybe you can view the WebAPI edition to see whether that works.

And I did quickly research, I found in the page https://www.nuget.org/packages/HangFire it mentioned:

Hangfire.AspNetCore
• Fixed – Add missing GetHttpContext extension method for the .NET Core platform.

So does that means for 1.6.1 version the HttpContext won’t be null again?

Regards,

Don