I have the same problem, I currently have my ETL in VS2019 and SQL2022. When I run it, I get an error in the Script Task.
I followed the advice to change the "Deployment Target Version" to 2019, but my connections to the files, both source and destination, give me the connection error. I have tried to make the connections again, but without success.
Someone who has had the same thing happen to them and has found the solution.