ProfanityFilter.Hosting
13.4.0
dotnet add package ProfanityFilter.Hosting --version 13.4.0
NuGet\Install-Package ProfanityFilter.Hosting -Version 13.4.0
<PackageReference Include="ProfanityFilter.Hosting" Version="13.4.0" />
<PackageVersion Include="ProfanityFilter.Hosting" Version="13.4.0" />
<PackageReference Include="ProfanityFilter.Hosting" />
paket add ProfanityFilter.Hosting --version 13.4.0
#r "nuget: ProfanityFilter.Hosting, 13.4.0"
#:package ProfanityFilter.Hosting@13.4.0
#addin nuget:?package=ProfanityFilter.Hosting&version=13.4.0
#tool nuget:?package=ProfanityFilter.Hosting&version=13.4.0
Profanity Filter: Hosting
This .NET library adds the Potty Mouth profanity-filter API to an Aspire AppHost as a first-class ContainerResource. The default container image is ghcr.io/ievangelist/profanity-filter-api:13.4.0.
The integration is built for Aspire 13.4 and uses analyzer-validated [AspireExport] metadata, so the same package works from C# AppHosts and generated TypeScript AppHost SDKs.
Get started
To install the ProfanityFilter.Hosting NuGet package:
aspire add ProfanityFilter.Hosting
C# AppHost
var builder = DistributedApplication.CreateBuilder(args);
var filter = builder.AddProfanityFilter("profanity-filter")
.WithCustomDataBindMount("./CustomData");
builder.AddProject<Projects.MyApi>("api")
.WithReference(filter)
.WaitFor(filter);
builder.Build().Run();
TypeScript AppHost
Use apphost.mts with the Aspire 13.4 generated SDK under .aspire/modules:
import { createBuilder } from "./.aspire/modules/aspire.mjs";
const builder = await createBuilder();
const filter = await builder
.addProfanityFilter("profanity-filter")
.withCustomDataBindMount("./CustomData");
await builder.addProject("api", { project: "../src/MyApi/MyApi.csproj" })
.withReference(filter)
.waitFor(filter);
const app = await builder.build();
await app.run();
Do not edit files under .aspire/modules; Aspire regenerates them when packages are added or restored.
Exported API
| C# API | TypeScript API | Description |
|---|---|---|
AddProfanityFilter(name) |
builder.addProfanityFilter(name) |
Adds the profanity-filter API container to the application model. |
WithCustomDataBindMount(source) |
.withCustomDataBindMount(source) |
Bind-mounts newline-delimited *.txt word lists into /app/CustomData. |
ProfanityFilterResource.HttpsEndpoint |
httpsEndpoint() |
Exposes the HTTPS endpoint used by the generated connection string. |
This library pairs with ProfanityFilter.Client, which registers typed REST and SignalR clients that consume the resource connection string.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Aspire.Hosting (>= 13.4.0)
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Hosting (>= 10.0.8)
- Microsoft.Extensions.Http (>= 10.0.8)
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 |
|---|---|---|
| 13.4.0 | 56 | 6/2/2026 |
| 13.3.0 | 99 | 5/8/2026 |
| 9.0.7-alpha.0.10 | 283 | 12/15/2025 |
| 9.0.7-alpha.0.9 | 239 | 12/15/2025 |
| 9.0.7-alpha.0.8 | 251 | 12/15/2025 |
| 9.0.7-alpha.0.7 | 402 | 12/11/2025 |
| 9.0.7-alpha.0.2 | 243 | 3/6/2025 |
| 0.0.0-alpha.0.273 | 238 | 12/15/2025 |