'Track down .Net6 app publish dependencies

Is there any way to figure out what exactly brings in an assembly dependency in a .Net6 application during a publish?

My problem specifically is that a pure WPF application is bringing in very large WinForms dlls, not just the runtime but also the design time dlls, and I can't figure out why. Nothing seems to be referencing them in my code and I'm certain I'm not using any WinForms code, but still it's there. There isn't even any <UseWindowsForms> project tag to bring in the references.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source