Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at Rougamo.ExMoAttribute.TryResolve(Type type, Func`3& func)
at Rougamo.ExMoAttribute.OnSuccess(MethodContext context)
代码如下:
`
using Rougamo.Context;
using Rougamo;
using System.Threading.Tasks;
using System;
//Unhandled exception.System.NullReferenceException: Object reference not set to an instance of an object.
// at Rougamo.ExMoAttribute.TryResolve(Type type, Func`3& func)
// at Rougamo.ExMoAttribute.OnSuccess(MethodContext context)
new TestClass().Get();
Console.ReadLine();
public class TestClass
{
[General]
[Ex]
public T Get() where T : new()
{
return new T();
}
}
internal class GeneralAttribute : MoAttribute
{
public override void OnSuccess(MethodContext context)
{
Console.WriteLine("success");
}
}
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object. at Rougamo.ExMoAttribute.TryResolve(Type type, Func`3& func) at Rougamo.ExMoAttribute.OnSuccess(MethodContext context)
代码如下: ` using Rougamo.Context; using Rougamo; using System.Threading.Tasks; using System;
//Unhandled exception.System.NullReferenceException: Object reference not set to an instance of an object. // at Rougamo.ExMoAttribute.TryResolve(Type type, Func`3& func) // at Rougamo.ExMoAttribute.OnSuccess(MethodContext context) new TestClass().Get();
Console.ReadLine();
public class TestClass { [General] [Ex] public T Get() where T : new()
{
return new T();
}
}
internal class GeneralAttribute : MoAttribute { public override void OnSuccess(MethodContext context) { Console.WriteLine("success"); } }
internal class ExAttribute : ExMoAttribute { protected override void ExOnSuccess(MethodContext context) { Console.WriteLine("exsuccess"); } } `