Recently, I've been updating a bunch of Visual Studio Azure Functions and Blazor projects to .NET 8.0 from 7.0. Most went smoothly but when I came to run the Azure Functions project locally in Visual Studio, I ran into this error:
Error: There is no Functions runtime available that matches the version project specified by the project
I checked the .csproj file and I have the correct TargetFramework
set to 8.0
.
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
<OutputType>Exe</OutputType>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>[projectname].functions</RootNamespace>
</PropertyGroup>
After consulting Google, I came across this Stack Overflow post which resolved my issues. For simplicity, I'll include the steps below.
In Visual Studio, in the menu bar go to Tools \> Options \> Projects and Solutions > Azure Functions
Press Check for updates and then Download & Install
Once complete, I was able to run my Azure Functions locally!