Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analytical anomaly #19

Open
yesexiaoxiao opened this issue Dec 27, 2019 · 0 comments
Open

Analytical anomaly #19

yesexiaoxiao opened this issue Dec 27, 2019 · 0 comments

Comments

@yesexiaoxiao
Copy link

/// <summary> /// 泛型单例 /// </summary> /// <typeparam name="T"></typeparam> public abstract class BaseInstance<T> where T : class,new() { private readonly static object lockObj = new object(); private static T instance = null; protected bool IsConnect = false; public static T Instance { get { if (instance == null) { lock (lockObj) { if (instance == null) { instance = new T(); } } } return instance; } } } public class Testclass : BaseInstance<Testclass> { [OperationContract] public void Test(string a) { //return 3; } }

Demo code:
static void Main(string[] args)
{
//define a joinpoint
var _operationContractJoinpoint = new Func<MethodBase, bool>(_Method => _Method.IsDefined(typeof(OperationContractAttribute), true));

        //instantiate a calculator
        var _calculator = new Calculator();

        //weave logging for all operation contract
        Aspect.Weave<Logging>(_operationContractJoinpoint);

        //invoke an operation contract (logging is enabled)
        var _return = _calculator.Divide(15, 3);
        Testclass.Instance.Test("test");
     }

The .Net Reflector Analytical anomaly and NConcern.Example.Basic Demo Exception:

在 System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
在 System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()
在 System.Reflection.RuntimeMethodInfo.GetParameters()
在 System.Diagnostics.StackTrace.ToString

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant