Project builds using Rider but UBT fails when running a build script

UE5.4 / Windows 10

I am running into an issue: my project builds without issues in the Editor but when I try to set up a build script, the build fails.
Taking 3 steps for this:

  1. Generate Project files
  2. Run UBT
  3. Run UAT

(the dotnet part of) UBT (Engine\Build\BatchFiles\Build.bat)complains about a missing target file:

Blockquote Couldn’t find target rules file for target ‘[module]’ in rules assembly ‘UE5Rules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’

The target file does exist in the Source folder and the module is configured (as Runtime) in the .uproject file.

When I leave out the ubt step, uat complains about the missing module:

Message dialog closed, result: Ok, title: Message, text: The game module ‘[module]’ could not be found. Please ensure that this module exists and that it is compiled.

I have copied the uat parameters which are reported in the log when running the (successful) build in the editor.

I am running the script from a clean project (no Binaries, Intermediate etc) and the project contains 1 custom plugin.

So after spending some time on Google I’ve found a solution.
It turns out you don’t need the UBT but you just run UAT for the Editor:

%UE_PATH%\Engine\Build\BatchFiles\RunUAT.bat BuildEditor -project=%PROJECT_PATH% -notools

Then run UAT for the project build using the parameters as the can also be seen in the log when building from within the editor, the build completes fine.

1 Like