Skip to content

Build with Command Line

Ingo edited this page Nov 15, 2026 · 11 revisions

Build YAF.NET v4 with the command line

Requirements

  1. .NET 11.0 SDK or later
  2. Node.js (current LTS version)

Build

  1. Install the Node packages. In the yafsrc/YetAnotherForum.NET folder run:

    npm install
  2. Compile the JavaScript and CSS files (in the same folder):

    npm run build

    This runs the default task of build.js (node build.js works as well): it bundles the JavaScript with webpack, collects the Font Awesome icons used by the forum and compiles the CSS of the forum and of all themes.

    [!NOTE] Since v4.0.11 the build uses the Node script build.js. Grunt and the Gruntfile.js are gone, a global grunt-cli is not needed anymore.

    Other tasks you can run with npm run [task]:

    Task Description
    css Only compiles the CSS (forum, admin and all themes), without the JavaScript.
    webpack Only bundles the JavaScript.
    emailTemplates Builds the email templates of the themes with bootstrap-email.
    webp Converts the images to WebP.
    themeKit Creates the npm package @yafnet/theme-kit in yafsrc/YAFNET.ThemeKit, see Themes.
    updateVersionNumber Writes the version of package.json into the project and NuGet files.

    The full list is in the scripts section of package.json.

  3. Build the solution for your database from the yafsrc folder:

    Database Command
    Microsoft SQL Server dotnet build YAF.NET-SqlServer.slnx
    MySQL / MariaDB dotnet build YAF.NET-MySql.slnx
    PostgreSQL dotnet build YAF.NET-PostgreSQL.slnx
    SQLite dotnet build YAF.NET-Sqlite.slnx

Run

Start the web project from the yafsrc/YetAnotherForum.NET folder, e.g. for SQL Server:

dotnet run --project YAF-SqlServer.csproj

Set the connection string in appsettings.json first (see Installation). On the first start you are redirected to the installation wizard.

To run your local source in Docker instead, see Docker - Test compose files.

Clone this wiki locally