MrAdvice 2.19.1

dotnet add package MrAdvice --version 2.19.1
                    
NuGet\Install-Package MrAdvice -Version 2.19.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MrAdvice" Version="2.19.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MrAdvice" Version="2.19.1" />
                    
Directory.Packages.props
<PackageReference Include="MrAdvice" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MrAdvice --version 2.19.1
                    
#r "nuget: MrAdvice, 2.19.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MrAdvice@2.19.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MrAdvice&version=2.19.1
                    
Install as a Cake Addin
#tool nuget:?package=MrAdvice&version=2.19.1
                    
Install as a Cake Tool

Mr. Advice

Summary

Mr. Advice is an open source (and free of charge) alternative to PostSharp (which is still far more advanced, see https://www.postsharp.net).
It intends to inject aspects at build-time. Advices are written in the form of attributes, and marking methods with them makes the pointcut, resulting in a nice and easy aspect injection.
More information about what is an aspect at Wikipedia.

Mr. Advice can weave assemblies for:

  • .NET framework ≥4.6.1 / Mono
  • .NET ≥5
  • .NET Standard 2.0

Mr. Advice allows you to:

  • Advise methods or parameters, at assembly, type, method or parameter level
  • Advice types (at assembly startup)
  • Introduce fields
  • Advise Mr. Advice (and this is BIG) at weaving-time (during build step), so you can rename methods as they are advised, add properties, etc.

How it works

It is available as a NuGet Status package. There is also an automatic build with tests at appveyor. The current status is Build status

Philosophy

Currently, MrAdvice won't bring you any aspect out-of-the-box. This means you'll have to write your own aspects (however you can see below other packages using Mr. Advice).
So it brings us to the next chapter, which is...

How to implement your own aspects

In a nutshell

Here is the minimal sample:

public class MyProudAdvice : Attribute, IMethodAdvice
{
    public void Advise(MethodAdviceContext context)
    {
        // do things you want here
        context.Proceed(); // this calls the original method
        // do other things here
    }
}

You then just need to mark the method(s) with the attribute and that's it, your aspect is injected!

[MyProudAdvice]
public void MyProudMethod()
{
}

More details

Your aspects can be injected at assembly, type or method level, simply by setting the attribute:

  • When an aspect is injected at asembly level, all methods of all types are weaved.
  • When the aspect is injected at type level, all of its methods are weaved.
  • And of course, if the aspect is injected on a method, only the method is weaved.

Other projects using Mr. Advice

NuGet packages:

Miscellaneous projects:

Project owner is picrap, feel free to drop a mail ✉️.
Project company is Arx One, a french company editor of backup software solutions.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (27)

Showing the top 5 NuGet packages that depend on MrAdvice:

Package Downloads
MrAdvice.Fody

Obsolete! Use https://www.nuget.org/packages/MrAdvice/ instead! MrAdvice allows to weave aspects at build-time (just like PostSharp, but free as in free beer). Write your own aspects in the form of attributes and apply them to target methods or properties.

MrAdvice.MVVM

MrAdvice.MVVM is a lightweight MVVM library. It implements NotifyPropertyChanged, DependencyProperty (dependency and attached), A command binder and some threading management.

ZLSoft.QWPlatform.SystemLibraryCore

公共类库组件

SD.AOP.Core

SD.AOP 面向方面编程基础

ArxOne.Persistence

A simple persistence library. Simply mark properties with attributes and they are persisted in registry.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.19.1 8,846 2/20/2025
2.19.0 190 2/17/2025
2.17.0 4,975 11/28/2024
2.16.0 20,796 8/20/2024
2.15.0 34,645 2/1/2024
2.14.0 1,867 1/8/2024
2.13.0 1,150 11/17/2023
2.12.2 4,277 5/12/2023
2.12.2-t1 653 5/12/2023
2.12.1 4,751 3/28/2023
2.12.0 12,376 3/11/2023
2.11.3 1,050 3/5/2023
2.11.2 746 3/5/2023
2.11.1 774 3/5/2023
2.11.0 721 3/5/2023
2.10.1 19,339 12/20/2022
2.10.0 856 12/19/2022
2.9.9 2,302 11/5/2022
2.9.8 5,720 9/21/2022
2.9.7 168,033 2/18/2022
2.9.6 1,394 1/28/2022
2.9.6-testing3 686 1/25/2022
2.9.6-testing2 671 1/24/2022
2.9.6-testing1 616 1/6/2022
2.9.5 6,420 12/18/2021
2.9.4 2,151 12/1/2021
2.9.3 898 11/27/2021
2.9.2 9,525 9/17/2021
2.9.1 2,380 8/1/2021
2.9.0 11,961 4/26/2021
2.9.0-test1 775 4/25/2021
2.8.12 59,169 12/24/2020
2.8.11 10,565 7/19/2020
2.8.10 12,310 2/16/2020
2.8.9-embed1 2,636 1/9/2020
2.8.8 31,411 10/5/2019
2.8.7 1,313 10/5/2019
2.8.6 8,437 9/6/2019
2.8.5 17,134 3/29/2019
2.8.4 2,683 3/27/2019
2.8.3 3,163 3/18/2019
2.8.2 41,505 11/29/2018
2.8.1 3,089 11/29/2018
2.8.0 2,789 11/28/2018
2.7.2 5,879 10/23/2018
2.7.1 2,778 10/23/2018
2.7.0 3,360 10/8/2018
2.6.0 10,555 9/24/2018
2.5.30 2,831 9/23/2018
2.5.29 2,776 9/21/2018
2.5.28 2,816 9/20/2018
2.5.27 2,801 9/20/2018
2.5.25 12,276 8/12/2018
2.5.24 26,723 2/13/2018
2.5.23 3,235 2/8/2018
2.5.22 3,246 2/8/2018
2.5.21 3,152 2/7/2018
2.5.20 3,227 2/2/2018
2.5.19 7,243 12/17/2017
2.5.18 3,243 12/17/2017
2.5.18-pre2 2,767 11/11/2017
2.5.18-pre 2,776 11/8/2017
2.5.18-exp4 3,019 12/17/2017
2.5.18-exp3 3,043 12/15/2017
2.5.17 21,310 11/1/2017
2.5.16 6,940 8/14/2017
2.5.15 3,590 8/12/2017
2.5.14 2,955 8/11/2017
2.5.13 3,055 8/10/2017
2.5.12 2,929 8/9/2017
2.5.11 3,049 8/7/2017
2.5.10 3,136 8/7/2017
2.5.9 3,055 8/6/2017
2.5.8 3,110 8/6/2017
2.5.7 2,957 8/6/2017
2.5.6 2,997 8/5/2017
2.5.5 3,019 8/5/2017
2.5.4 19,372 6/26/2017
2.5.3 3,116 6/25/2017
2.5.2 3,097 6/14/2017
2.5.1 3,141 5/24/2017
2.5.0 3,418 4/16/2017
2.4.8 5,852 3/15/2017
2.4.7 3,325 3/10/2017
2.4.6 3,058 3/10/2017
2.4.5 14,730 12/28/2016
2.4.4 3,135 12/27/2016
2.4.3 3,989 12/7/2016
2.4.2 3,118 12/3/2016
2.4.1 3,034 12/3/2016
2.4.1-test1 2,837 12/2/2016
2.4.0 3,139 11/25/2016
2.4.0-test5 2,843 11/24/2016
2.4.0-test4 2,894 11/23/2016
2.3.5 3,154 11/10/2016
2.3.5-pre1 3,241 11/8/2016
2.3.5-name1 2,921 11/10/2016
2.3.4 3,291 11/8/2016
2.3.2 3,200 11/7/2016
2.3.1 3,386 11/6/2016
2.2.0 3,451 11/5/2016
2.1.3 3,363 11/2/2016
2.1.2 3,146 10/24/2016
2.1.1 3,033 10/24/2016
2.1.0 3,415 10/22/2016
2.1.0-pre3 2,759 10/21/2016
2.1.0-pre2 2,841 10/20/2016
2.1.0-pre1 2,847 10/19/2016
2.0.22 3,158 10/19/2016
2.0.21 3,127 10/19/2016
2.0.20 3,083 10/18/2016
2.0.19 3,020 10/18/2016
2.0.18 3,120 10/18/2016
2.0.17 3,032 10/18/2016
2.0.16 2,996 10/17/2016
2.0.15 3,054 10/17/2016
2.0.14 3,070 10/17/2016
2.0.13 3,132 10/16/2016
2.0.12 3,131 10/16/2016
2.0.10 3,044 10/15/2016
2.0.9 3,087 10/14/2016
2.0.8 3,022 10/13/2016
2.0.7 3,081 10/13/2016
2.0.6 2,997 10/12/2016
2.0.5 2,951 10/8/2016
2.0.4 3,061 10/8/2016
2.0.3 3,006 10/8/2016
2.0.2 3,025 10/8/2016
2.0.1 3,034 10/8/2016
2.0.0 4,454 10/2/2016
2.0.0-alpha4 2,840 10/2/2016