Orchardcms NullReferenceException由null TermPart.As<;引起;自动布线部分>;()果园CMS 1.7.2

Orchardcms NullReferenceException由null TermPart.As<;引起;自动布线部分>;()果园CMS 1.7.2,orchardcms,nullreferenceexception,orchardcms-1.7,Orchardcms,Nullreferenceexception,Orchardcms 1.7,横杆: 我使用的是Orchard 1.7.2,我的站点中到处都会出现这种错误(我认为这会导致加载时间减慢): 因此,我跟踪了这个问题,并在TermPart.cs(第16行)中找到了函数publicstringslug 公共字符串段塞{ get{返回this.As().DisplayAlias;} 设置{this.As().DisplayAlias=value;} } 我发现this.As()为空,并且检查内容项的部分(通过this.ContentItem.parts),没有自动路由部分。由于它

横杆:

我使用的是Orchard 1.7.2,我的站点中到处都会出现这种错误(我认为这会导致加载时间减慢):

因此,我跟踪了这个问题,并在TermPart.cs(第16行)中找到了函数publicstringslug

公共字符串段塞{
get{返回this.As().DisplayAlias;}
设置{this.As().DisplayAlias=value;}
}
我发现
this.As()
为空,并且检查内容项的部分(通过
this.ContentItem.parts
),没有自动路由部分。由于它为null,因此在尝试检索属性DisplayAlias时会引发null引用异常

见下图:


这是一个已知的问题吗?有解决办法吗?这就是导致我的网站速度减慢的原因吗?

尽管这些异常肯定会影响性能,但我怀疑它是否会导致明显的速度减慢

例外情况是由分类法的TermPart根据AutoroutePart引起的;i、 如果您的内容项不使用AutoroutePart(在我看来这应该是非常罕见的),那么您将看到此异常。使TermPart依赖于自动路由是一个有问题的设计决策(至少它可以使用IAliasSpect代替)。请打开有关此问题的错误报告,因为应该以某种方式解决此问题


同时,您可以将AutoroutePart附加到相关内容类型,以消除异常。

谢谢您的回复!我宁愿不要将ARP附加到所有既没有也不需要它的现有CT上。我认为暂时更新TermPart更为理想。
Orchard.DisplayManagement.Implementation.DefaultDisplayManager - NullReferenceException thrown from Action`1 by System.Action`1[[Orchard.DisplayManagement.Implementation.ShapeDisplayingContext, Orchard.Framework, Version=1.7.2.0, Culture=neutral, PublicKeyToken=null]]
System.NullReferenceException: Object reference not set to an instance of an object.
   public string Slug {
        get { return this.As<AutoroutePart>().DisplayAlias; }
        set { this.As<AutoroutePart>().DisplayAlias = value; }
    }