azure-functions-host: Debug startup fails "no Function runtime available"
Investigative information
Please provide the following:
- Timestamp:
- Function App version (1.0 or 2.0): 3.0 Visual Studio 2019 16.3.6
Repro steps
Provide the steps required to reproduce the problem:
Start project in debug mode locally. Immediately a Microsoft Visual Studio Error appears - “There is no Functions runtime available that matches the version specified in the project.”
Here is the csproj properties, as far as I know this has not changed since it was working last.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<AzureFunctionsVersion>v3-preview</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.0.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Kafka" Version="1.0.0-alpha" />
<PackageReference Include="Microsoft.Extensions.Http" Version="3.0.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.30-beta2" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="local.settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>
</Project>
Expected behavior
It builds fine, it should startup at least.
Actual behavior
Fails to startup or even enter the azure function prompt.
Known workarounds
None
Related information
Provide any related information
- Programming language used - C#
- Links to source - N/A simple project on local
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 40 (7 by maintainers)
The solution provided by @soninaren worked on my side where I experienced the same issue of the page getting stuck on
"Making sure all templates are up to date..."
.Pay attention on the manifest JSON file though (the one inside each
Release
version folder) because it is pointing to a different user, so you may need to adjust that before opening Visual Studio.@brettsam i think i know what is causing the update failures. With 16.4 we switched to using x64 version of cli. However the x64 version of CLI being used is not minified like x86. The core tools x64 zip file is
140 mb (x64) vs 50 mb (x86)
and the same extracted is350 mb (x64) vs 112 mb (x86)
. This would be the likely reason for hangs.@optiks and @wahyuen as a workaround can do the following:
%userprofile%\.templateengine
%userprofile%\AppData\Local\AzureFunctionsTools
%userprofile%\AppData\Local\AzureFunctionsTools
@michaeldaw if you want to still run and debug I was able to get this started by opening cmd/powershell to the root of my project then running func.exe start:
C:\temp\projectroot\> C:\Users\[user]\AppData\Local\AzureFunctionsTools\Releases\3.0.2\cli\func.exe start
or you can add a new debug profile that runs the executable:
We needed to update the feed so that it aligns with different versions of visual studio. We misinterpreted which function release version would map to which version of VS effectively causing the v3-preview disappear.
In case you are getting constant errors, delete the following 2 folders, close all instances of VS and open VS again.
%userprofile%\AppData\Local\AzureFunctionsTools
%userprofile%\.templateengine
It has been started to happen for me since today morning (I did not have any problem before that. I updated my VS 2019 to 16.3.9, nothing has been changed). I do not know if I should trust this preview or not. I need to push my code to production as soon as possible. Can someone from the team give me a proper answer?
This should be fixed now. Please close and re-open visual studio.
Hi,
Any update on this issue. I upgraded my azure v2 functions to v3 yesterday and they were working fine. Suddenly since today morning I’m not able to run my functionapp solution. Facing same error “no Function runtime available”.
My feed json doesnt have v3 version in it though I ahev version 3 folders in my Releases folder. Updating it manually is getting overridden when visual studio is opened.
Yesterday I upgraded my VS2019 version to 16.3.6. Not sure if issue is because of this or something else. Any help would be appreciated
I can confirm that is the same for me. @michaeldaw how did you figure that one out?
It seems that the entry for v3-preview in the
C:\Users\[user]\AppData\Local\AzureFunctionsTools\feed.json
file is automatically deleted when you start visual studio and try to make a new function project.@soninaren / @vijayrkn – any ideas on this one? Seems like people are hanging while trying to update the templates?
I’m having the same issue as @wahyuen. Any tips?
This is less than ideal and blocking us upgrading to .NET Core 3.1, folks…
Is there any workaround available if we are consistently stuck on
Making sure all templates are up to date...
?? I’ve tried this a number of times already with rebooting and restarting VS2019 16.4 but it just seems to hang at that stage even after an hour!@Dongbumlee download VS2019 preview 4. The VS2019 version should be 16.4.0. that will fix your problem.
@Shrn-Prmshr and @jagge123 Now you have to use Visual Studio 2019 Preview 3 or 4 (previously you could use other versions, but as of Nov 11 it must be Preview 3 or 4). They changed the instructions in the blog post.
Thank you @soninaren. It seems to be working for me. FYI for others: when I first opened visual studio to create a project, I didn’t see the v3-preview option right away. I had to wait for the “updating templates” message to complete, then clicked Back, and created the project again. At that point, v3-preview was visible.