System.ArgumentNullException: Value cannot be null.
Parameter name: httpContext
at System.Web.HttpContextWrapper..ctor(HttpContext httpContext)
at Umbraco.Web.SingletonHttpContextAccessor.get_Value()
at Umbraco.Web.RequestLifespanMessagesFactory.Get()
at Umbraco.Core.Services.MediaService.Umbraco.Core.Services.IMediaServiceOperations.Save(IMedia media, Int32 userId, Boolean raiseEvents)
at Umbraco.Core.Services.MediaService.Save(IMedia media, Int32 userId, Boolean raiseEvents)
I am still unable to find the fix. Do you have code snippet which I can re-use in my custom code? I am running into same scenario where I am saving content in thread which is running in background.
MediaService.Save gives an error, when I use a fake UmbracoContext
Hi,
I updated Umbraco from 7.3.7 to 7.4.2.
I use a fake UmbracoContext to Save contents inside a System.Threading.Tasks.Task
I followed the instructions on https://gist.github.com/sniffdk/7600822.
In this case it works:
In this case not:
This is the exception I get:
Can anyone help me to figure it out?
Thanks! :)
Giordano
Maybe it depends on this: http://issues.umbraco.org/issue/U4-7577
As a fix, I overrided CreateServiceContext of WebBootManager
I am still unable to find the fix. Do you have code snippet which I can re-use in my custom code? I am running into same scenario where I am saving content in thread which is running in background.
is working on a reply...