添加Sitecore占位符时出现“不允许空字符串”错误

时间:2013-09-06 14:22:48

标签: sitecore

尝试将占位符添加到Sitecore 6.5中的布局时,出现以下错误消息:

“不允许使用空字符串。< br>参数名称:xml”

知道可能是什么问题吗?日志中将显示以下堆栈跟踪:

1124 10:20:56 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_default_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\59ed33b7\d6112557\App_Web_edgk4py3.1.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 System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Sitecore.Reflection.ReflectionUtil.CallMethod(Type type, Object obj, String methodName, Boolean includeNonPublic, Boolean includeInherited, Object[] parameters)
   at Sitecore.Reflection.ReflectionUtil.CallMethod(Object obj, String methodName, Boolean includeNonPublic, Boolean includeInherited, Object[] parameters)
   at Sitecore.Web.UI.HtmlControls.Component.HandleMessage(Message message)
   at Sitecore.Shell.Framework.Commands.ClientEventCommand.SendEventMessage()
   at Sitecore.Shell.Framework.Commands.ClientEventCommand.Execute(CommandContext context)
   at Sitecore.Web.UI.Sheer.ClientPage.RaiseEvent()
   at Sitecore.Web.UI.Sheer.ClientPage.OnPreRender(EventArgs e)
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Nested Exception

Exception: System.ArgumentException
Message: Empty strings are not allowed.
Parameter name: xml
Source: Sitecore.Kernel
   at Sitecore.Diagnostics.Assert.ArgumentNotNullOrEmpty(String argument, String argumentName)
   at Sitecore.Layouts.LayoutDefinition.Parse(String xml)
   at Sitecore.Shell.Applications.Layouts.DeviceEditor.DeviceEditorForm.OnOK(Object sender, EventArgs args)

2 个答案:

答案 0 :(得分:1)

我遇到了这个问题,发现问题的根源是web.config中的设置InvalidItemNameCharsItemNameValidation为空。

一旦我将值恢复为默认值,我就删除了导入包含无效字符的包的值,如下所示,异常停止发生。

<setting name="InvalidItemNameChars" value="\/:?&quot;&lt;>|[]" />

<setting name="ItemNameValidation" value="^[\w\*\$][\w\s\-\$]*(\(\d{1,}\)){0,1}$" />

答案 1 :(得分:0)

最常见的是,这与您的语言设置有关。比如说;如果您的用户(通过默认内容语言)设置为使用某种语言编辑项目,则您正在编辑的当前项目没有特定于语言的版本。

所以,例如;你在“en”中存在的项目 - 以及你登录的用户;默认为“da-DK” - 并且当前项目在“da-DK”中没有版本。

我很久没见过这个bug了,我原以为它已经修好了。

可能根本不是这个问题,但很难从有关该问题的有限信息中辨别出来。

查看您的用户设置;如果您的网站定义中定义的任何“ContentLanguage”属性可能与您期望的不同,那么也是如此。

相关问题