Azure Function App Runtime not available in Visual Studio 2019 Version 16.11.4
I have an azure function app which is running in Visual Studio 2019. I updated the project to use the TargetFramework from .net 5.0 to .net 6.0 and I also have Microsoft.NET.Sdk.Functions version 4.0.1 installed. Here is an image of the .csproj file
When I try to run the application I get the following error in a message box:
"There is no Functions runtime available that matches the version specified in the project"
What should I do to let it work ?
Solution 1:
To use .NET6 you will need to update to VS2022 in order to utilize the correct frameworks.
Solution 2:
I tried to reproduce the issue you're facing when migrating from .Net 5 to .Net 6 in Visual Studio 2019:
In Visual Studio 2019,
In Visual Studio 2022, these are the additional options of Functions Runtimes available:
And Migrating from .Net 5 Isolated to .Net 6 only in any editor will not work as you can see in below screenshot: there will be some worker extensions packages will be missed from the .Net 6 Azure Functions comparing to .Net 5.
After adding the Worker extensions, migrating the required packages from .Net 5 Iso to .Net 6 will gives the target assembly version error and also the above error like No function runtime specified
, etc.
When Migrating from .Net 5 Isolated to .Net Isolated in VS 2022, it will run successfully as you can see in below screenshot:
According to this MSFT Documentation, Out-of-process Isolated environments are .Net 5.0 and .Net 6.0.
Isolated (out-of-process) .Net Project has some set of unique packages, which implement both core functionality and binding extensions.
Therefore, try migration of .Net 5 Isolated to .Net 6 Isolated as shown above, runs successfully.