Fire and forget (ARCH103)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Key dotnet.async.fire-and-forget · Severity warning · Category async
A call returning a Task should be awaited or assigned to a variable. Otherwise exceptions are lost and execution continues before the work completes.
Incorrect
Section titled “Incorrect”public async Task HandleAsync(){ _repository.SaveAsync(); await _notifier.NotifyAsync();}Correct
Section titled “Correct”public async Task HandleAsync(){ await _repository.SaveAsync(); await _notifier.NotifyAsync();}Await the Task, or explicitly assign it to a variable if intentional. If needed, suppress the rule per project/workspace via except/ignore.