StackOverflow: How to create WPF System Tray Icon when no "Main" host window exists
In .NET 5+ set <UseWPF>true</UseWPF>
and <UseWindowsForms>true</UseWindowsForms>
in the project file.
Mostly Robot
In .NET 5+ set <UseWPF>true</UseWPF>
and <UseWindowsForms>true</UseWindowsForms>
in the project file.