I finally converted a C++/CLI assembly to .NET 5.0. It used to target .NET Framework 4.8. I had to remove old references (e.g. System.Windows) and instead directly
System.Windows