Curiosus.Tools.Web 3.0.0

dotnet add package Curiosus.Tools.Web --version 3.0.0
                    
NuGet\Install-Package Curiosus.Tools.Web -Version 3.0.0
                    
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="Curiosus.Tools.Web" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Curiosus.Tools.Web" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Curiosus.Tools.Web" />
                    
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 Curiosus.Tools.Web --version 3.0.0
                    
#r "nuget: Curiosus.Tools.Web, 3.0.0"
                    
#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 Curiosus.Tools.Web@3.0.0
                    
#: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=Curiosus.Tools.Web&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Curiosus.Tools.Web&version=3.0.0
                    
Install as a Cake Tool

Curiosus.Tools.Web

NuGet Downloads Coverage

ASP.NET Core helpers for MVC sites and APIs: middleware (exception handling, request logging, performance measuring, reverse proxy), model binders, data protection setup, reCAPTCHA, sitemap and assorted HTTP extensions.

Installation

dotnet add package Curiosus.Tools.Web

Usage

using Curiosus.Tools.Web.Middleware;
using Curiosus.Tools.Web.MimeTypes;
using Curiosus.Tools.Web.ModelBinders;
using Curiosus.Tools.Web.ReverseProxy;

// services
services.AddReverseProxy(configuration.ReverseProxy);   // ForwardedHeaders for ProxyIps; no-op when null
services.AddMimeTypeMapping();                          // MimeMappingService
services.AddMvc(options => options.ModelBinderProviders.Insert(0, new TrimStringModelBinderProvider()));

// pipeline
app.UseReverseProxy(configuration.ReverseProxy);        // forwarded headers + PathBase
app.UseCuriosusExceptionHandler("/error");              // logs and re-executes the pipeline with /error
app.UsePerformanceMeasurer();
app.UseRequestLogging();                                // dumps request bodies, masks SensitiveDataProtector fields
app.UseRouting();

UseRequestLogging resolves a non-generic ILogger from DI (registered by Curiosus.Hosting.Web).

What else is inside:

  • Model binding — TrimStringModelBinderProvider, InvariantDecimalModelBinderProvider, DateTimeModelBinderProvider, DelimitedArrayModelBinder, TrimStringSystemJsonConverter for [FromBody] strings.
  • Middleware — UseUserTracer (trace id cookie, needs UniqueIdGenerator.Initialize), UseLocalizationSetter (language cookie), UsePreviewDetector (rewrites the path for link-preview bots).
  • Options-driven services — AddCuriosusDataProtection(DataProtectionOptions) / DisableDataProtection(), AddReCaptcha(ReCaptchaOptions) + ReCaptchaService, AddSiteMap(mvcBuilder) + SiteMapBuilder, ConfigureCookiesForOldBrowsers() (SameSite fixes).
  • MVC — MVCBaseController (error views, AJAX responses, redirects), SiteError, ModelStateExtensions.AddModelErrorIf, Page<T>/Paginator, InvariantDecimalTagHelper.
  • Extensions — HttpContext/HttpRequest (IsAjaxRequest, GetAbsoluteUrl, ...), ISession JSON objects, HtmlSanitizerHelper.

TrimStringNewtonsoftConverter is obsolete and will be removed with the Newtonsoft.Json dependency.

HTTP requests go through the HttpClient named ReCaptchaService.HttpClientName from IHttpClientFactory, which AddReCaptcha registers. Configure it for timeouts, a proxy or resilience handlers:

services.AddHttpClient(ReCaptchaService.HttpClientName, client => client.Timeout = TimeSpan.FromSeconds(30));

See also

Product Compatible and additional computed target framework versions.
.NET 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Curiosus.Tools.Web:

Package Downloads
Curiosus.Hosting.Web

Hosting tools for Web applications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 54 10/3/2026
2.0.0 60 9/28/2026