As title says, it seems you can't use WindowsRuntimeMarshal.GetActivationFactory in .net 6, but you can in .net framework.