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

  • Home
  • SEARCH
  • 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 8615129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:17:53+00:00 2026-06-12T05:17:53+00:00

Is Microsoft working on a solution for AOP in C#? What are the (real

  • 0

Is Microsoft working on a solution for AOP in C#? What are the (real AOP) alternatives?

Bonus question: is Code Contracts a kind of AOP?

  • 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-06-12T05:17:54+00:00Added an answer on June 12, 2026 at 5:17 am

    Most dependency injection frameworks in .net have the ability to use AOP techniques, I personally prefer Ninject and the Interceptor plugin as its simple to use and doesn’t require any class pollution with 3rd party attributes or anything.

    That being said Spring.net, Castle Windsor and lots of other DI frameworks support the same principle with slightly different syntax and approaches, some are xml driven some are c# driven so you can have compile time safety.

    One thing to think about is that most DI frameworks do this via class proxying, so they require your methods to be virtual and then at runtime it proxies your class method and you can intercept at that point. There are some other approaches such as IL weaving which is what PostSharp does, which can be faster than proxying, although I dont have any measurements to back that up.

    Didn’t see the bonus question bit, for me I would say its not a clear cut answer, as it depends on how you use it, as generally you are using AOP as a way to separate your non functional concerns such as logging, transactions maybe validation from your source code, so you add this logic from the outside in, so ideally your source code has no knowledge of the AOP happening (although that’s not always the case if you are using some 3rd party attributes which will couple your source code to the AOP framework).

    As code contracts can be written in-line with existing classes or hooked in via attributes or I believe can be fully injected at runtime, so much like logging concerns you could put them all into your classes but when using an AOP approach you wouldn’t. So for me Code Contracts are just a tool to enforce something, you can use it in an AOP fashion or you can just embed it in your code.

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

Sidebar

Related Questions

Following the walkthrough at http://msdn.microsoft.com/en-us/library/ee707351(v=VS.91).aspx I have a working Silverlight solution that employs a
I'm working in Microsoft SQL Server Management Studio CLR registering .dlls into the database
I have an issue working with Microsoft.Build.BuildEngine which supposed to get fixed modifing my
I am confused over getting and clearing when working in Microsoft C. Like when
What do you use for data synchronization? I have been working with Microsoft Sync
How i can convert number 20020415 to date 15.04.2002. I am working in Microsoft
I am working on a Windows (Microsoft Visual C++ 2005) application that uses several
I'm working on a Microsoft Access application for a summer camp to track which
I'm working on a DSL in Microsoft's new M Grammar, and it needs to
I'm working on a simple web project for mobile in Microsoft Webmatrix 2.0. For

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.