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.