SimpleBitware.AspectNet 1.0.3

dotnet add package SimpleBitware.AspectNet --version 1.0.3
                    
NuGet\Install-Package SimpleBitware.AspectNet -Version 1.0.3
                    
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="SimpleBitware.AspectNet" Version="1.0.3">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SimpleBitware.AspectNet" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="SimpleBitware.AspectNet">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
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 SimpleBitware.AspectNet --version 1.0.3
                    
#r "nuget: SimpleBitware.AspectNet, 1.0.3"
                    
#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 SimpleBitware.AspectNet@1.0.3
                    
#: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=SimpleBitware.AspectNet&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=SimpleBitware.AspectNet&version=1.0.3
                    
Install as a Cake Tool

<img src="resources/logo.png" width="110" align="right"></br></br>

AspectNet

AspectNet brings Aspect-Oriented Programming (AOP) to any .NET project through compile‑time IL weaving. </br> It enables the creation of cross‑cutting behaviors and ASP.NET‑style middleware pipelines that can be applied to any class, method, constructor, or property—regardless of visibility or static/instance context.

Basic usage

  1. Import SimpleBitware.AspectNet NuGet package into the target project.
  2. Create a custom attribute implementing IAspectNetAttribute interface or extending AbstractAspectNetAttribute abstract class. Or just use the included AspectNet attributes.
  3. Decorate classes and/or class members with AspectNet attributes:
public class LogAttribute : AbstractAspectNetAttribute
{
   public override void OnEntry(AspectNetAttributeContext context)
   {
      base.OnEntry(context);
   }

   public override void OnSuccess(AspectNetAttributeContext context)
   {
      base.OnSuccess(context);
   }

   public override void OnException(AspectNetAttributeContext context)
   {
      base.OnException(context);
   }

   public override void OnExit(AspectNetAttributeContext context)
   {
      base.OnExit(context);
   }
}  

public partial class OrderService
{
    [Log(Priority = 1)]
    public async Task PlaceOrderAsync(string id) { ... }
}
  1. Aspect code will be weaved into the decorated method at build time.

Documentation

More about AspectNet on SimpleBitware website.

Would you like to contribute?

Discover here how you can contribute to a better developer experience for all.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 37 5/16/2026