SimpleBitware.AspectNet
1.0.3
dotnet add package SimpleBitware.AspectNet --version 1.0.3
NuGet\Install-Package SimpleBitware.AspectNet -Version 1.0.3
<PackageReference Include="SimpleBitware.AspectNet" Version="1.0.3"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="SimpleBitware.AspectNet" Version="1.0.3" />
<PackageReference Include="SimpleBitware.AspectNet"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add SimpleBitware.AspectNet --version 1.0.3
#r "nuget: SimpleBitware.AspectNet, 1.0.3"
#:package SimpleBitware.AspectNet@1.0.3
#addin nuget:?package=SimpleBitware.AspectNet&version=1.0.3
#tool nuget:?package=SimpleBitware.AspectNet&version=1.0.3
<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
- Import
SimpleBitware.AspectNetNuGet package into the target project. - Create a custom attribute implementing
IAspectNetAttributeinterface or extendingAbstractAspectNetAttributeabstract class. Or just use the included AspectNet attributes. - 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) { ... }
}
- 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.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.Build.Utilities.Core (>= 18.4.0)
- Microsoft.Extensions.Logging (>= 10.0.7)
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 |