During a current project I came across this error because my Azure Functions are planned to run on .net 8. There is by default the runtime for .net 7 available, but this leads to the following error, which blocked me a moment.
„There is no Functions runtime available that matches the version in the project.“
This is a handicap if you want to test Azure Functions locally.
A small investigation later, I found a solution which is simple but hidden in the depth of Visual Studio. The fix for the problem is hidden in Visual Studio options dialog.
Just click Download & Install and hit F5. And enjoy the beauty of Azure Functions running locally.