error CS1061: 'IEnumerable<Attribute>' does not contain a definition for 'Length' and no extension method 'Length' accepting a first argument of type 'IEnumerable<Attribute>' could be found (are you missing a using directive or an assembly reference?)
I have this error using Unity 2018 when i try to compile with .Net instead of IL2CPP This is the line where i get the error:
if (methods[i].GetCustomAttributes(typeof(CompilerGeneratedAttribute), true).Length != 0)
{
continue;
}
And, in this other method:
var ret = (Delegate.CreateDelegate(typeof(V), target, method) as V);
also, in this method i used methodinfo instead of Delegate. but then ask about no method using 3 values.
Also added "using system.Linq"
Best regards
2条答案
按热度按时间rlcwz9us1#
实际上,您希望测试
IEnumerable<T>
中是否有 * 任何 * 项:如果坚持使用
Length != 0
方法,正确的语法是fhity93d2#
好的,现在这样做很好:
现在好了,对方错误在:
我尝试使用MethodInfo,但不起作用。“Delegate”不包含“CreateDelegate”的定义