I’m trying to get url of variants from a background service.
variant.GetUrl always return with exception.
When checked in detail, its from UrlServiceImpl,
_routeRequestLookupInfoAccessor.RouteRequestLookupInfo.IsInAdministration is causing exception as
RouteRequestLookupInfo is null.
Error:
Object reference not set to an instance of an object.
at Litium.Application.Web.UrlServiceImpl.GetUrl(Variant variant, ProductUrlArgs args)
at Litium.Accelerator.Mvc.App_Start.UrlServiceDecorator.GetUrl(Variant variant, ProductUrlArgs args) in Litium.Accelerator.Mvc\App_Start\UrlServiceDecorator.cs:line 53
at Litium.Foundation.Modules.ExtensionMethods.VariantExtensions.GetUrl(Variant arg, Boolean absoluteUrl, Category currentCategory, Nullable`1 channelSystemId)
Are you sending in an existing variant and setting the ProductUrlArgs from your implementation of Litium.Accelerator.Mvc\App_Start\UrlServiceDecorator.cs?
Yes. An existing variant. ProductUrlArgs have all the details, except websitesystemid (Its Guid.Empty) and Category(its null)
On decorator, the first line is
var url = _parent.GetUrl(variant, args); which is returning exception