Sitecore:启用页面编辑器时参数超出范围

时间:2015-07-10 12:30:20

标签: asp.net asp.net-mvc sitecore sitecore7.2

现在唯一的目标是运行Sitecore页面编辑器而不会出现问题。错误来自以下网址:

http://localhost/sitecore/shell/Applications/WebEdit/WebEditRibbon.aspx?db=master&id={guid}&la=en&vs=1&url=%2F&mode=edit&sc_pagesite=website&trf=%2Ftemp%2Fdiagnostics%2Ftrace_{guid}.xml&prf=%2Ftemp%2Fdiagnostics%2Fprofile_{guid}.xml&dev={guid}

当我打开任何启用了页面编辑器的页面时,我收到此异常:

16028 13:57:46 ERROR Application error.
Exception: System.Web.HttpUnhandledException
Message: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Source: System.Web
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP.sitecore_shell_applications_webedit_webeditribbon_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d565cb3\44f479ba\App_Web_pyaedh12.0.cs:line 0
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Nested Exception

Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Sitecore.Reflection.ReflectionUtil.CallMethod(Type type, Object obj, String methodName, Boolean includeNonPublic, Boolean includeInherited, Boolean includeStatic, Object[] parameters)
   at Sitecore.Web.UI.Sheer.ClientPage.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Nested Exception

Exception: System.ArgumentOutOfRangeException
Message: startIndex cannot be larger than length of string.
Parameter name: startIndex
Source: mscorlib
   at System.String.Substring(Int32 startIndex, Int32 length)
   at Sitecore.Links.LinkProvider.LinkBuilder.GetItemPathElement(Item item, SiteInfo site)
   at Sitecore.Links.LinkProvider.LinkBuilder.BuildItemUrl(Item item)
   at Sitecore.Links.LinkProvider.GetItemUrl(Item item, UrlOptions options)
   at Sitecore.Providers.LinkProvider.GetItemUrl(Item item, UrlOptions options)
   at Sitecore.Web.WebEditUtil.GetItemUrl(Item item)
   at Sitecore.Shell.Applications.WebEdit.WebEditRibbonForm.RenderTreecrumbGo(HtmlTextWriter output, Item item)
   at Sitecore.Shell.Applications.WebEdit.WebEditRibbonForm.RenderTreecrumb(Item item)
   at Sitecore.Shell.Applications.WebEdit.WebEditRibbonForm.OnLoad(EventArgs e)

禁用页面编辑器时页面呈现正常。

正在运行的版本:

  • Sitecore 7.2。
  • ASP.NET MVC 5.2.3(也尝试过5.1.3)。

我已尝试在布局/渲染中删除与Sitecore相关的任何内容,但仍会出现该错误。我意识到在没有看到配置文件的情况下找出正在发生的事情是不可能的,但是希望有人在此之前偶然发现了这个错误!

谢谢!

1 个答案:

答案 0 :(得分:1)

问题是rootPath属性。它似乎不能低于/sitecore/content两级。当我将其从/sitecore/content/foo/bar更改为/sitecore/content/foo时,它再次发挥作用。希望Sitecore资深人士可以解释为什么会这样!