I just wanted to post this here since a lot of people browse this forum for solutions (I did)
This also affects Nintex workflows:
(Just in case it gets removed)
Error presents itself as:
09/18/2025 16:30:31.47 OWSTIMER.EXE (0x1BE8) 0x1844 SharePoint Foundation Legacy Workflow Infrastructure amq7q Medium Workflow on association 'Test Workflow' compile had errors: <Error><CompilerError Line="-1" Column="-1" Text="Compilation failed. Cannot execute a program. The command being executed was "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe" /noconfig /fullpaths @"C:\Users\mossfarmacct\AppData\Local\Temp\wxaoqzay.cmdline"." /></Error>
Solution
This issue is currently under investigation.
To mitigate the problem using the following Workaround:
Open Windows Settings and navigate to the following Exploit Prevention settings:
Windows Settings
Privacy & Security
Windows Security
App & Browser Control
Exploit Protection Settings
Program Settings
OWSTIMER.EXE
Edit the settings for OWSTIMER.EXE and set the following option to “Off”:
Do not allow child processes
The SharePoint Timer Service (SPTimerV4) needs to be stopped and restarted after this configuration change.