ILRuntime.Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly : 'Assembly-Charp, Version=0.0.0.0,Culture=nuetral,PublicKeyToken=null'
主工程定义了这个Attribute
public enum InfoType{
Log,
Error,
}
public class InfoAttribute
{
readonly string Name;
readonly InfoType Type;
public InfoAttribute(string name, InfoType type){
Name = name;
Type = type;
}
}
Hotfix里用了这个Attribute
var type = domain.GetType("com.test.TestInfo");
var obj = type.ReflectionType.GetCustomAttribute(typeof(InfoAttribute));
Debug.LogError(obj);
//结果 obj == null
断点查找后发现
namespace ILRuntime.Reflection
{
static class Extensions
{
public static object CreateInstance(this CustomAttribute attribute, IType at, Runtime.Enviorment.AppDomain appdomain)
// ........
//attribute.HasConstructorArguments 在vs里报AssemblyResolutionException
}
}
应该是ILRuntime不支持内部解析报错了
把InfoType 换成int类型就好了
目前不知道怎么支持
坑了一天时间