You need to update Microsoft.NET.Sdk.Functions specifically for the project.
Go into the folder of the functions project (Not the solution, but the actual project) and open a powershell window there.
Then run: dotnet add package Microsoft.NET.Sdk.Functions --version 4.5.0