Ltmonster.AspNetCore.DynamicMiddleware
1.0.1
dotnet add package Ltmonster.AspNetCore.DynamicMiddleware --version 1.0.1
NuGet\Install-Package Ltmonster.AspNetCore.DynamicMiddleware -Version 1.0.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="Ltmonster.AspNetCore.DynamicMiddleware" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ltmonster.AspNetCore.DynamicMiddleware" Version="1.0.1" />
<PackageReference Include="Ltmonster.AspNetCore.DynamicMiddleware" />
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 Ltmonster.AspNetCore.DynamicMiddleware --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Ltmonster.AspNetCore.DynamicMiddleware, 1.0.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 Ltmonster.AspNetCore.DynamicMiddleware@1.0.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=Ltmonster.AspNetCore.DynamicMiddleware&version=1.0.1
#tool nuget:?package=Ltmonster.AspNetCore.DynamicMiddleware&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
🚩 Ltmonster.AspNetCore.DynamicMiddleware
This is a plugin that supports the dynamic manipulation of middleware while the application is running. The middleware is created the same way as the original, but registered differently.
🔍 Installation
First, install NuGet. Then, install Ltmonster.AspNetCore.DynamicMiddleware from the package manager console:
PM> Install-Package Ltmonster.AspNetCore.DynamicMiddleware
Or from the .NET CLI as:
dotnet add package Ltmonster.AspNetCore.DynamicMiddleware
🚀 Basic usage
First, write your middleware. As follows:
public sealed class Plugin1(RequestDelegate next)
{
public async Task InvokeAsync(HttpContext context)
{
Console.WriteLine("start plugin1");
await next(context);
Console.WriteLine("end plugin1");
}
}
Then, register in Program.cs
builder.Services.AddDynamicMiddleware();
app.UseDynamicMiddleware()
.InstallPlugin<Plugin1>("Plugin1", "This is the first plugin");
Finally, to control the plugin by DynamicMiddlewareContainer
var container = app.ApplicationServices.GetRequiredService<DynamicMiddlewareContainer>();
container.EnablePlugin("Plugin1");
container.DisablePlugin("Plugin1");
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Microsoft.AspNetCore.OpenApi (>= 8.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.