In-process background tasks for desktop apps need to use the COM background tasks: https://video2.skills-academy.com/windows/uwp/launch-resume/create-and-register-a-winmain-background-task
However, if you're writing a C# app, the docs and samples don't work for .NET 5 and have to be updated, and our team is currently investigating how to use in-process COM background tasks from a C# .NET 5 WinUI 3 app.
Out-of-process background tasks using the classic packaging project and a separate WinRT Component Library project should work, but as you mention it is additional complexity.