1

在我将CodeEffects.Rule.Editor.Web.Corenuget 从 v5.0.14.6 升级到 v5.0.19.4 后,我NullReferenceException在调用时收到以下信息RuleEditor.GetClientSettings()

 Message: 
    System.NullReferenceException : Object reference not set to an instance of an object.
  Stack Trace: 
    Encoder.GetHashToken(MethodInfo m, String sourceTypeFullName)
    SourceLoader.GetTokenByMethod(XmlNode source, Type type, Type sourceObject, String methodName, XmlNodeList parameters, Boolean isMethod)
    SourceLoader.GetTokenBySourceMethodNode(XmlNode source, XmlNode method, Type sourceObject)
    Settings.Load(IControl control, ICollection`1 contextMenuRules, XmlDocument sourceXml, ICollection`1 dataSourceHolders, Boolean plainSourceXml)
    RuleEditor.GetConditions()
    RuleEditor.GetClientSettings()

通过消除,我将注意力集中到以下方法,这似乎是导致错误的原因(这在 v5.0.14.6 中有效):

[Method("IsSingle")]
public bool IsSingle<T>([Parameter(ValueInputType.Fields, Description = "array")] IEnumerable<T> array)
{
   return array != null && array.Distinct().SingleOrDefault() != null;
}
4

1 回答 1

0

今天发布的最新版本 5.0.20.6 修复了这个问题。请注意,如果您使用 SourceXML 作为源对象,则不能使用带有通用参数的通用方法。如果您愿意,请切换到普通的 .Net 类或新的 FlexSource 技术。有关详细信息,请参阅文档文章。

于 2020-05-29T18:00:18.967 回答