A delegate is called asynchronously with BeginInvoke, which .NET Core and later do not support
What it finds
The asynchronous BeginInvoke and EndInvoke of delegates throw PlatformNotSupportedException on .NET Core and every later .NET. Task.Run(() => handler(...)) runs the delegate on the thread pool on every runtime. Calls on controls, as in Windows Forms, are a different method and are left alone.
From the rule's source, delegate_begin_invoke.rs.
using System; class Worker{ void Start(Action work) { work.BeginInvoke(null, null);tx0 reports: BeginInvoke on a delegate throws on .NET Core and later }} Turn it on, off or suppress it
The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/csharp:delegate-begin-invoke" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/csharp:delegate-begin-invoke] reason="..."tx0 explain tx0/csharp:delegate-begin-invoke shows the same in the terminal. Found a false positive? Report it.