YAFNET.RazorPages 4.0.11

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

YAFLogo

YAF.NET Razor Pages Client Library

Prerequisites:

  • ASP.NET Core 10.0 (YAF v4.x)

Quick Guide

Add the YAF Nuget Packages

  1. Install the YAFNET.RazorPages Package via Nuget Browser or the console

NuGet

> dotnet add package YAFNET.RazorPages
  1. Depending on which Data Provider you want top use add the package ..

YAFNET.Data.SqlServer Package via Nuget Browser or the console

NuGet

> dotnet add package YAFNET.Data.SqlServer

YAF.Data.MySQL Package via Nuget Browser or the console

NuGet

> dotnet add package YAFNET.Data.MySQL

YAFNET.Data.PostgreSQL Package via Nuget Browser or the console

NuGet

> dotnet add package YAFNET.Data.PostgreSQL

YAFNET.Data.Sqlite Package via Nuget Browser or the console

NuGet

> dotnet add package YAFNET.Data.Sqlite

Getting Started

Program.cs

In the Program.cs add the following.

 var builder = WebApplication.CreateBuilder(args);

builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory());

builder.Host.ConfigureYafLogging();

builder.Host.ConfigureContainer<ContainerBuilder>(containerBuilder =>
{
    containerBuilder.RegisterYafModules();
});

builder.Services.AddRazorPages(options =>
{
    options.Conventions.AddAreaPageRoute("Forums", "/SiteMap", "/Sitemap.xml");
}).AddYafRazorPages(builder.Environment);

builder.Services.AddYafCore(builder.Configuration, "/Forums");

// only needed for blazor
builder.Services.AddServerSideBlazor();

var app = builder.Build();

....

app.RegisterAutofac();

app.UseAntiXssMiddleware();

app.UseStaticFiles();

app.UseSession();

app.UseYafCore(BoardContext.Current.ServiceLocator, app.Environment);

app.UseRobotsTxt(app.Environment);

app.MapRazorPages();

app.MapAreaControllerRoute(
    name: "default",
    areaName: "Forums",
    pattern: "{controller=Home}/{action=Index}/{id?}");

app.MapControllers();

app.MapHub<NotificationHub>("/NotificationHub");
app.MapHub<ChatHub>("/ChatHub");

await app.RunAsync();

Now the Forum is ready and you can add a link to your _Layout.cshtml

 <li class="nav-item">
     <a class="nav-link" asp-area="Forums" asp-page="/Index">Forums</a>
 </li>

Community Support Forum

See a real live YAF Forum by visiting the YetAnotherForum.NET community support forum: https://yetanotherforum.net/forums. Also, get your questions answered by the YAF community.

License

Yet Another Forum.NET is licensed under the Apache 2.0 license.

Yet Another Forum Community Support

If you have any questions, please visit the YAF Community Support forum: https://yetanotherforum.net/forums, or visit the Wiki for More Informations.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
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 YAFNET.RazorPages:

Package Downloads
YAFNET.Umbraco.Forums

Runs the YAF.NET (YetAnotherForum.NET) forum inside an Umbraco site, with single sign-on through Umbraco Members.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.11 81 11/14/2026
4.0.10 205 10/21/2026
4.0.9 184 8/30/2026
4.0.8 168 8/10/2026
4.0.7 170 8/2/2026
4.0.6 199 6/20/2026
4.0.5 272 4/26/2026
4.0.4 347 1/10/2026
4.0.2 452 9/24/2025
4.0.1 333 8/31/2025
4.0.0 629 3/16/2025
4.0.0-rc04 574 11/17/2024
4.0.0-rc03 827 7/6/2024
4.0.0-rc02 321 5/29/2024
4.0.0-rc01 305 5/29/2024
4.0.0-beta09 262 5/18/2024
4.0.0-beta07 282 3/28/2024
4.0.0-beta05 286 2/28/2024

* [NEW] Search: new option "Search for" with Posts (all matching posts), Topics (one result for each topic, with its latest matching post) and Forums (the forums with a matching name)
* [NEW] Short urls: the public pages have shorter lowercase urls (/topic/1/name, /forum/1/name, /post/1/name, /user/1/name, /category/1/name, /album, /albums, /members, /active-users and /team), the page number of a topic is in the path (/topic/1/name/2), the slugs are lowercase and at most 80 characters long, the old urls and urls with an outdated name redirect permanently to the new url
* [NEW] Reactions: the thanks button is replaced by reactions (like, love, haha, hooray, wow) as on Facebook or GitHub, each user can give one reaction to a post, change it, or remove it by clicking it again; the existing thanks are shown as love, and every reaction counts as a thanks for the profile statistics and the hide-thanks BB codes
* [NEW] Admin > Database > Backup (host admin): a zipped backup of the whole database every night (between 1 and 6 o'clock server time) or with "Backup now", the newest backups are kept (7 by default, 0 keeps all), the backups can be downloaded and deleted; the backups are stored outside wwwroot in the BackupFolder of the BoardConfiguration (default App_Data/Backups); the page is only shown when a backup is possible, Host Settings > Server Info shows why not; SQLite: a copy of the database file (VACUUM INTO)
* [NEW] Database backup for SQL Server: BACKUP DATABASE (COPY_ONLY, does not change the backup chain) into a folder that SQL Server and the application share, configured as SqlServerBackupFolder (the folder as SQL Server sees it) in the BoardConfiguration; the docker compose files share the volume yaf-backups between both containers; not available for Azure SQL, without the permission BACKUP DATABASE or when SQL Server doesn't see the folder of the application
* [NEW] Database backup for MySQL / MariaDB: a SQL dump made with MySqlBackup.NET over the connection of the forum (no mysqldump needed); the docker compose file stores the backups in the volume yaf-backups
* [NEW] Database backup for PostgreSQL: a SQL dump made with pg_dump (PgDumpPath in the BoardConfiguration, it must be the same or a newer version than the server); the docker image contains the newest PostgreSQL client tools, the docker compose file stores the backups in the volume yaf-backups
* [NEW] Database backup: the zip also contains the uploaded files and the images of the forum (wwwroot/uploads and wwwroot/images, of each board with MultiBoardFolders) in the folder wwwroot of the zip; files that can't be read are skipped and logged
* [NEW] Theme kit: the npm package @yafnet/theme-kit (same version as YAF.NET) contains the sources of all themes and the forum styles they import, its command line tool yafnet-theme creates a theme from one of them (npx yafnet-theme new mytheme --from cosmo) and builds it (npx yafnet-theme build: bootstrap-forum.min.css and the email templates, with bootstrap-email if installed, otherwise the prebuilt templates); custom themes no longer need the YAF.NET source code; npm run themeKit creates the package in yafsrc/YAFNET.ThemeKit, the manually triggered GitHub action "Release YAF.NET Theme Kit npm Package" publishes it
* [CHANGES] Themes: bootstrap-forum.scss imports Bootstrap and the forum styles from the sass load paths (@import "bootstrap/scss/bootstrap", "forum/chat.scss", ...) instead of relative paths, so a theme folder can be built outside of the source; the compiled css is unchanged
* [CHANGES] Search: a clear button resets the search page
* [CHANGES] Build: npm run webp converts the images with webp-converter directly in build.js, simple-webp-converter is removed because it depends on a vulnerable glob version (GHSA-3g3m-2fjr-6pw4, GHSA-g3hv-75wg-m249); gif files are converted with gif2webp so animations are kept
* [CHANGES] Build: Grunt (only in maintenance mode) is replaced by the Node script build.js, the tasks are started with npm run (npm run build, npm run css, npm run updateVersionNumber, ...)
* [CHANGES] Search: the options (search for, keywords, titles only, results per page) are buttons instead of select lists, changing one updates the results
* [CHANGES] Responses are now compressed (Brotli or gzip, also over https), the css and js files of the forum (several hundred KB) were sent uncompressed
* [CHANGES] The icon font (Font Awesome solid) is preloaded, the browser found it only after the css was loaded, the icons appeared later
* [CHANGES] The forum css only contains the Font Awesome icons used by the forum (found by the new build task fontAwesomeIcons, part of the build and css task) instead of all ~2600 icons: forum.min.css is 52 KB instead of 169 KB (10 KB instead of 29 KB compressed), forum-admin.min.css 39 KB instead of 151 KB
* [CHANGES] The css files no longer contain vendor prefixes for outdated browsers (autoprefixer uses the browserslist defaults instead of the last 2 versions of every browser), each theme is ~40 KB smaller
* [CHANGES] Notify dropdown in the user menu: shows the latest 5 notifications as dropdown items (the whole item links to the post, with the time of the notification) and a "See all Notifications" link to the notification page, instead of the list with the pager that didn't work
* [CHANGES] Admin > Run SQL Query: the results of a select are shown as a table (one table for each result set, NULL values marked, at most 1000 rows each), the CSV text is still available on the CSV tab; the records affected and SQL errors are shown as messages
* [FIXED] Build: dotnet tool restore installed bootstrap-email 1.7.1, which looked for its sass files and templates in its own tool folder, so the email templates could only be built with a global bootstrap-email; the tool manifest now uses version 2.0.0
* [FIXED] Database backup SQL Server: a relative SqlServerBackupFolder (e.g. App_Data/Backups) was passed unresolved to SQL Server, so the backup was always "not supported" (SQL Server didn't find the folder); an absolute folder of SQL Server on another OS (e.g. /var/opt/mssql/backup with the application on Windows) was turned into a Windows path
* [FIXED] Search: the similar topics parsed the topic title as query syntax, so a title with special characters (e.g. the colon of a time) threw a ParseException on every topic view; the query is now built from the analyzed title without the QueryParser (no internal "read past eof" IOException either)
* [FIXED] user profile when there are no user albums
* [FIXED] NuGet packages: YAFNET.UI.Chat no longer contains tsconfig.json and package-lock.json, YAFNET.RazorPages no longer contains package-lock.json
* [FIXED] Cache: deleted and updated rows were announced before the change was written, a delete without rows cleared the caches, and every UpsertAsync raised its event twice
* [FIXED] Cache: a new row was announced before it was written, so the caches were cleared too early and could be filled again with the old data
* [FIXED] OrmLite: the SqlServer, MySql and Sqlite string converters ignored a custom MaxColumnDefinition
* [FIXED] OrmLite MySql: the temporary file of the bulk insert now has a random name and is created exclusively
* [FIXED] Cookies: the cookies of the last visit and the panel states had no HttpOnly flag and no Secure flag, they are HttpOnly now and Secure on https
* [FIXED] Theme Brite: the css file was not minified, it was 297 KB instead of 246 KB
* [FIXED] Search: "All Forums" was not selected in the forum select of the search page, a search url without a forum had no forum selected, a forum in the url was ignored without a search text
* [FIXED] Search: the search keyword was not highlighted in the text of the results, the mark tags were html encoded and shown as text (the title was highlighted correctly)
* [FIXED] Topics: marking a post as answer added the topic id to the url of the post (?t=1)
* [FIXED] Topics: every link to a topic or post was redirected to a longer url (with p, t or m in the query) just to set the page number, the right page is now shown at the requested url; a new topic opens at its topic url
* [FIXED] Admin edit user: the tab shown first was loaded twice, the second response replaced the tab, changes made in the meantime (e.g. moderated or the rank in the user info) were lost when saving
* [FIXED] Register: the page after the registration (the message to confirm the e-mail address) had a script error, the password strength script was added without the password fields
* [FIXED] Register: visiting the register page again after a registration showed the message of the registration again instead of the form
* [FIXED] Search index update task: the nightly update indexed every post of each forum with new posts again (and loaded them all into memory at once), which caused a high cpu load for a long time on bigger boards; only the posts posted or edited since the last update are indexed now
* [FIXED] Background tasks (search index update, digest send, forum delete, prune topics) ignored their start delay and ran immediately, the search index update and digest task ran in the first page request after the start instead of 30 seconds later
* [FIXED] Docker (SQL Server): the database volume was mounted to a wrong path (/var/lib/mssqlql/data instead of /var/opt/mssql), the forum database was not stored in the volume and was lost when the container was recreated
* [FIXED] Docker compose files: the empty mail settings (MailConfiguration__Host / __Port) overrode the defaults with empty values, they are now commented-out examples (with UserName and Password); the setting MailConfiguration__Mail was removed, it doesn't exist
* [FIXED] Docker (SQLite): the database file was stored inside the container and was lost when the container was recreated (e.g. on an update), it is now stored in the volume sqlite-data
* [FIXED] Behind a reverse proxy that terminates https (nginx, Caddy, Traefik, a Docker proxy container), the forum ignored X-Forwarded-Proto and saw every request as http: links in e-mails and feeds started with http://, and the cookies were not marked as secure; X-Forwarded-Proto is now used for requests of trusted proxies (same as X-Forwarded-For)
* [FIXED] Static files: the Cache-Control header was invalid (max-age: 31536000 instead of max-age=31536000), browsers didn't cache the css, js, font and image files; files with a version (?v=) are now cached for a year, all others for a week
* [FIXED] Chromium browsers (Chrome, Edge) requested the first page of every visit twice, the user agent client hint Sec-CH-UA-Platform-Version was sent as critical (Critical-CH)
* [FIXED] The board logo was loaded lazily although it is at the top of the page, it was loaded late and moved the page content down
* [FIXED] Accessibility: the icon buttons of a post (reply, quote) had no accessible name on small screens, the link to the quoted post in a quote had none at all
* [FIXED] Multi quote button: the posts selected on another page of the topic were shown as not selected (they could not be deselected), the selected state wasn't visible, and the small checkbox was hard to hit on touch screens; the whole button is now a toggle button
* [FIXED] Error page (e.g. a page that doesn't exist): the home icon of the "Try Again" button was missing, the page didn't load the icon font css
* [FIXED] Admin dashboard: the start date of the board (e.g. "<strong>Today</strong> at 6:25:59 AM") was shown with its html tags as text
* [FIXED] Admin dashboard: the number of categories was shown in white on the light theme (the span had two class attributes)
* [FIXED] Search index: when the Search_Data folder can't be created or written (e.g. on Linux when the forum user has no write access to wwwroot) the error log only showed "Lock obtain timed out" and editing or deleting a post failed; now the folder and the user the forum runs as are logged, and the post is saved without updating the search index
* [FIXED] Admin > Run SQL Query: running a second query still showed the result of the first query (the posted result textarea overwrote the new result)
* [FIXED] Admin > Run SQL Query: running a query on PostgreSQL threw a NotImplementedException (the result is now read the same way for all databases)