4

This can be a debugging/monitoring process.

I want to know a way, preferably the best way, of calling a method every time other methods in a class/namespace/application are executed.

Code snippets, opinions and articles would be appreciated.

2 Answers 2

6

AOP; look at PostSharp, for example, which offers this type of weaving. Note that this approach works by chaning the IL during the build process, and may impact runtime performance if over-used.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks Mark, As I was searching I cam up with this platform, I was not familiar with this approach, Should I have make any changes in the structure of the project ?
@Sypress you would just have to add an assembly attribute (an "aspect").
1

Take a look at Aspect Oriented Programming(AOP). A good library for this is Postsharp.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.