0

I'm getting the following error message when I go to Experience Analytics from the dashboard in 9.0.2 (rev. 180604). We are using Glass Mapper elsewhere in the application, but there's no customization of the CMS

Error message

Here's a snippet of the problematic Sitecore file:

@using Newtonsoft.Json
@using Sitecore
@using Sitecore.ExperienceAnalytics.Client
@using Sitecore.ExperienceAnalytics.Core.Extensions
@using Sitecore.Mvc
@using Sitecore.Web.UI.Controls.Common.Renderings
@using Sitecore.Web.UI.Controls.Common.Texts
@using Sitecore.Web.UI.Controls.Common.UserControls
@using Globals = Sitecore.ExperienceAnalytics.Client.Globals
@model Sitecore.Mvc.Presentation.RenderingModel
@{
    var rendering = Html.Sitecore().Controls().GetUserControl(Model.Rendering);
    rendering.Class = "sc-DateRangeFilter";
    rendering.Requires.Script("client", "DateRangeFilter.js");
    rendering.Attributes.Add("data-bind", "visible: isVisible");
    rendering.HasNestedComponents = true;

    var errorMessages = new
    {
        InvalidDate = Helper.GetTextValue(Globals.System.Texts.ErrorMessages.InvalidDate)
    };

    rendering.Attributes.Add("data-sc-errortexts", JsonConvert.SerializeObject(errorMessages));
    rendering.Attributes.Add("data-sc-serverdate", DateUtil.ToServerTime(DateTime.UtcNow).ToDashedDateRangeFormat());
    rendering.Attributes.Add("data-sc-defaultdaterangeoffset-from", Config.DefaultDateRangeOffsetFrom.ToString());
    rendering.Attributes.Add("data-sc-defaultdaterangeoffset-to", Config.DefaultDateRangeOffsetTo.ToString());
}

It's complaining about: Config.DefaultDateRangeOffsetFrom.ToString()

I know I could probably track down the intended namespace and add it to the code, but is there a solution that doesn't involve changing Sitecore-owned files?

1

It looks like you might have a global namespace declared in your Web.config

Check your Web.config for the namespace Glass.Mapper.Sc.

You shouldn't need to have a namespace for this in your root Web.config and these should be configured in the views folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.