ILRuntime.Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly : 'Assembly-Charp, Version=0.0.0.0,Culture=nuetral,PublicKeyToken=null'
主工程定義了這個(gè)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里用了這個(gè)Attribute
var type = domain.GetType("com.test.TestInfo");
var obj = type.ReflectionType.GetCustomAttribute(typeof(InfoAttribute));
Debug.LogError(obj);
//結(jié)果 obj == null
斷點(diǎn)查找后發(fā)現(xiàn)
namespace ILRuntime.Reflection
{
static class Extensions
{
public static object CreateInstance(this CustomAttribute attribute, IType at, Runtime.Enviorment.AppDomain appdomain)
// ........
//attribute.HasConstructorArguments 在vs里報(bào)AssemblyResolutionException
}
}
應(yīng)該是ILRuntime不支持內(nèi)部解析報(bào)錯(cuò)了
把InfoType 換成int類型就好了
目前不知道怎么支持
坑了一天時(shí)間