I fixed the issue by updating to .NET 9. In VS 2022 i also had to click Tools => Options, and then enabling "Enable New .NET 9+ Mono Debugger"