Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 618933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:36:02+00:00 2026-05-13T18:36:02+00:00

I have an ASP.NET 3.5 SP1 Webforms Application. I use the MVP pattern (supervising

  • 0

I have an ASP.NET 3.5 SP1 Webforms Application. I use the MVP pattern (supervising controller) with DI (autofac). My presenters call to the repository contracts defined in my Domain (DDD) which are implemented in an Infrastructure project.

The repository methods the presenters call can hork, so I need to log exceptions and then set an error message on the View.

In the past I would have added another parameter to the Presenter constructors, stored the reference in a Base Presenter, and called a Log method in my Catch blocks. I don’t really like this, but it gets the job done.

I could go the route of using a factory to get the logging class as described here, but I’d like to explore AOP first, as it seems pretty interesting.

I have done the reading on compile-time vs runtime AOP, and I’d like to know what peoples’ experiences are with the different solutions, pluses, minuses, words of advice, etc.

From the digging I have done it seems like there are 4 main frameworks for AOP in .NET

  • Castle Windsor – I have stayed away from this in general because it does a whole lot of stuff I really don’t need
  • Spring.net – sounds like it has a good track record but inspires fear through its xml configuration (I don’t like non-fluent configurations)
  • PostSharp – Attribute driven (I like this) but at one point had some line number issues, not sure if they still exist
  • Unity – a whole lot of stuff I don’t really need

I see another question that has some good answers but its from a year and a half ago. Are there newer, "better", frameworks that have been developed in the meantime, or enhancements made to existing solutions that should be taken into consideration?

For reference, I chose Autofac for DI because its fluent, simple to use, couldn’t find any negative comments about it, and it just works.

Are there recommendations on which AOP framework I should try? Thanks for reading all of this and for adding any thoughts.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:36:03+00:00Added an answer on May 13, 2026 at 6:36 pm

    Short answer, for simplicity and ease of use, you really can’t go wrong with PostSharp.

    Longer answer: In my mind, you should choose between the two frameworks depending on what you are trying to achieve.

    If you want aspects that should change based upon context, consider Spring.NET (or any aop framework that injects code at runtime based on configuration). This allows you to customise the behaviour of your objects depending on what you are doing. For example, via your configuration, you may use one type of logging in a console app, and another in a web app. Note that Spring is also a DI container (and several other things) — it goes well beyond AOP, and it is definitely worth learning how to use.

    On the other hand, if you want behaviour that should always be in effect, regardless of context, then PostSharp (compile time weaving) is your best bet. This is effectively the same as if you include the code in each method you apply the aspect to.

    For what you’re doing, I recommend you start with PostSharp.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.