Edit (2024-10):
It looks like the orientation setting below works fine on my new machine with the latest Xcode, without extra hassle.
This doesn't work
What works
AppDelegate.swift
MainApp.swift
ContentView.swift
Ref: https://tutorial101.blogspot.com/2021/09/swiftui-view-portrait-mode-lock.html