Home > Net >  In a class c # realize monitoring function execution information.
In a class c # realize monitoring function execution information.

Time:09-20

Recently in looking for monitoring a class method is executed in the realization of information, over and over just can't baidu to related content, at sixes and sevens without a satisfactory, so we have to send a for help, request a great god give directions!!!!!!


One thought with TraceSource (pointed out in this class in Microsoft's official document traceability program execution) class, Process, tried not too will use, also because of busy tasks without further down, request a great god, beg god give directions!


Specific ideas as shown in the figure below:

CodePudding user response:

Google: PostSharp has

CodePudding user response:

There are many lightweight AOP libraries in nuget
Literally with a can

CodePudding user response:

refer to the second floor stherix response:
there are many lightweight AOP libraries in nuget
It is ok to casually with a

Precisely, this post is my hair, because of poor students party a only 20 points in the post to send off long ago, finally Joe classmate of , I explain my profession: the first joint halcon visual c # development, mainly using c # winform do front-end interface interaction, I felt at the time of development winform interface set of utility classes too much code too mixed and disorderly coupled is extremely high, because there is no found similar framework, to design a simple use, the framework of management in aop way these tools, custom attribute do method shows that reflection do specific tools nested classes, is now stuck in how to get to know the inside of the target class method is carried out on this,

CodePudding user response:

refer to the second floor stherix response:
there are many lightweight AOP libraries in nuget
It is ok to casually with a

If I have described this type of framework, please specify, thank you,

CodePudding user response:

Define a global variable, execute inside method when=1, monitoring the variable=1 to 0

CodePudding user response:

I knew I should strive in reference 5 floor response:
define a global variable, execute inside method when=1, monitoring the variable=1 to buy 0

No, no, no, I don't want to in business code to add any code has nothing to do with the main business, this is the core of aop thought,,,

CodePudding user response:

reference aaaaabin reply: 3/f
Quote: refer to the second floor stherix response:
there are many lightweight AOP libraries in nuget
It is ok to casually with a

Precisely, this post is my hair, because of poor students party a only 20 points in the post to send off long ago, finally Joe classmate of , I explain my profession: the first joint halcon visual c # development, mainly using c # winform do front-end interface interaction, I felt at the time of development winform interface set of utility classes too much code too mixed and disorderly coupled is extremely high, because there is no found similar framework, to design a simple use, the framework of management in aop way these tools, custom attribute do method shows that reflection do specific tools nested classes, is now stuck in how to get to know the inside of the target class method is carried out on this,

The building Lord have thought, the same requirements
  •  Tags:  
  • C#
  • Related