If you want to use .NET8 keep using it, but in global.json file keep the version 9.0.0 this is the SDK version.
Things will work fine this way.