WYSIWYG editing Image gallery upload Content templates
Detailed setup guide

Installation

Complete installation instructions for the RichTextBox ASP.NET Core package, including NuGet setup, Program.cs configuration, license file placement, and upload endpoint mapping.

Step 1

Install the NuGet Package

Install via the .NET CLI:

dotnet add package RichTextBox

Or via the Visual Studio Package Manager Console:

Install-Package RichTextBox

Or add directly to your .csproj:

<PackageReference Include="RichTextBox" Version="1.0.0-preview.1" />

Step 2

Configure Program.cs

Register the RichTextBox services and map the upload endpoints. You can customize the upload path, allowed extensions, and maximum file size.

var builder = WebApplication.CreateBuilder(args);

// Register RichTextBox services with default options
builder.Services.AddRichTextBox();

// Or with custom options:
builder.Services.AddRichTextBox(options =>
{
    options.UploadWebPath = "/uploads";
    options.MaxUploadBytes = 4 * 1024 * 1024; // 4 MB
    options.AllowedImageExtensions = new[] { ".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg" };
    options.AllowedFileExtensions = new[] { ".zip", ".pdf", ".doc", ".docx" };
});

var app = builder.Build();
app.UseStaticFiles();

// Map upload and gallery endpoints
app.MapRichTextBoxUploads();

app.MapRazorPages();
app.Run();

Step 3

Register the Tag Helper

Add the RichTextBox Tag Helper to your Pages/_ViewImports.cshtml:

@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, RichTextBox

Step 4

Place the License File

The package validates a license file before rendering editors or accepting uploads. Place RichTextBox.lic in your project's content root directory (the same folder that contains Program.cs).

License file location

YourProject/
  Program.cs
  RichTextBox.lic         <-- content root
  appsettings.json
  Pages/
    _ViewImports.cshtml
    Index.cshtml
  wwwroot/
    uploads/              <-- image upload target

License file format

RichTextBox License
License Number: 30076785
Licensed to: Your Company Name

The trial download (richtextbox.zip) includes a pre-configured license file so you can evaluate immediately.

Step 5

Create the Upload Directory

Create a wwwroot/uploads folder for image uploads. The gallery endpoint will browse and upload images into this directory.

mkdir wwwroot/uploads

On deployed servers, ensure the application pool identity has write access to this folder.

Step 6

Verify the Installation

Add a simple editor to any page and run your application:

<richtextbox name="Body" toolbar="default" height="300px" />

If the editor renders with a toolbar, your installation is complete. If you see a license error, verify that RichTextBox.lic is in the content root and the license number matches.

Step 7

Files deployed to wwwroot

The NuGet package copies the static web assets into your site's wwwroot/richtexteditor/ at publish time. For a 2.0 deployment the notable additions are:

  • plugins/aitoolkit.js — Ask AI dropdown + docked AI Chat + AI Review drawer.
  • plugins/aitoolkit.css — AI Toolkit styles (required alongside aitoolkit.js).
  • plugins/structured-content-bridge.jswindow.RichTextEditorStructuredContent helpers (fromMarkdown, toMarkdown, renderHTML, validateStructuredContent).
  • rte.js — includes the rte-config.js defaults block at the top. Edit RTE_DefaultConfig values directly to change every editor on the site without rebuilding.

AI Toolkit: BYOK pattern. The default resolver is a local demo that needs no API key. For production, register an IRichTextBoxAiResolver with dependency injection (server-side) or swap the resolver on the client via editor.aiToolkit.setResolver(fn). Your resolver calls your own backend (which holds the provider API key in its secrets store) and returns { result, reason, operations }. See the BYOK demo.