Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug startup fails "no Function runtime available" #5145

Closed
zpittmansf opened this issue Oct 24, 2019 · 40 comments
Closed

Debug startup fails "no Function runtime available" #5145

zpittmansf opened this issue Oct 24, 2019 · 40 comments

Comments

@zpittmansf
Copy link

zpittmansf commented Oct 24, 2019

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
@zpittmansf
Copy link
Author

Ok it definitely has to do with this line:
<AzureFunctionsVersion>v3-preview</AzureFunctionsVersion>

If I switch that to v2 it will at least start up but will fail to recognize the functions. func.exe actually executes.

@michaeldaw
Copy link

I'm also having this issue. I went through the steps detailed here, but I don't see Azure Functions v3 Preview in the list of available templates:
image
I tried running a function app that was created in the v3-preview on another machine, where it worked as expected, but I get the error mentioned by @zpittmansf on my current machine. It seems like it can't find the v3 preview template(s).

@zpittmansf
Copy link
Author

@michaeldaw I just tried to create a fresh project and even though yesterday it worked today I have the same result.
image

I double checked that the environment variable is in place as well.
image

@michaeldaw
Copy link

Actually, I could have sworn it was working yesterday as well. Maybe something has changed?

@zpittmansf
Copy link
Author

Latest commit was 7 days ago on the master branch, I don't see any releases in github that match beta version listed here, not sure why?
Azure/azure-functions-vs-build-sdk@ca38d6b

@michaeldaw
Copy link

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.

@zpittmansf
Copy link
Author

I can confirm that is the same for me. @michaeldaw how did you figure that one out?

@zpittmansf
Copy link
Author

Azure/azure-functions-tooling-feed@ddc1e19 just changed yesterday

@zpittmansf
Copy link
Author

zpittmansf commented Oct 24, 2019

@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:
image

@a-vishar
Copy link

Followed these instructions, unable to see any V3 options in the dropdown and when I try to run an existing project with a manual upgrade I get the "There is no Functions runtime available that matches the version specified in the project." error.

@michaeldaw
Copy link

@zpittmansf very nice, thanks for the tip. Hopefully this gets sorted out soon.

@mhoeger
Copy link
Contributor

mhoeger commented Oct 24, 2019

@soninaren - could you comment on this issue?
cc: @brettsam

@pavitrag123
Copy link

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

@soninaren
Copy link
Member

This should be fixed now. Please close and re-open visual studio.

@michaeldaw
Copy link

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.

@zpittmansf
Copy link
Author

@soninaren what was the fix? I am just curious.

@soninaren
Copy link
Member

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.

@jagge123
Copy link

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.

Still not working for me :/

@Shrn-Prmshr
Copy link

Shrn-Prmshr commented Nov 13, 2019

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?

@kristofferjalen
Copy link

@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.

@dirq
Copy link

dirq commented Nov 13, 2019

Mine stop working after I upgraded Visual Studio to 16.3.9 yesterday. ;(

@dirq
Copy link

dirq commented Nov 13, 2019

I just downloaded the latest VS2019 preview, and I could run the function again.

@prohith46
Copy link

Same issue for me - Any update on this ?

@Dongbumlee
Copy link

what's wrong with that? after updating VS2019, it makes trouble again. - version 16.3.9 :(

@Shrn-Prmshr
Copy link

I have downloaded VS2019 preview 4, VS2019 16.4.0. and my problem has been solved!

@Shrn-Prmshr
Copy link

@Dongbumlee download VS2019 preview 4. The VS2019 version should be 16.4.0. that will fix your problem.

@david-peden-q2
Copy link

Confirmed works with Preview 5 as well.

image

@MedAnd
Copy link

MedAnd commented Dec 4, 2019

Worked once with the latest VS preview and some hours later the same issue came back as everyone above is reporting!

image

@brettsam
Copy link
Member

brettsam commented Dec 4, 2019

@MedAnd -- I know we had a brief period yesterday where the VS tooling was using the wrong feed details -- you may have run across that. Can you try closing VS and re-opening it again? That should prompt it to update.

Also note that VS 16.4.0 released officially (non-preview) yesterday which has this support.

If you continue to see this I'll dive in deeper.

@MedAnd
Copy link

MedAnd commented Dec 4, 2019

@brettsam - I tried with VS 16.4.0 today and it fails to launch the function project in debug mode as per above issue... to work around I had to set debug options to:

C:\Users<user>\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\func.exe

Also tried using VS Code but cannot get it to work with the Preview... have pinged @jeffhollan in various forums & awaiting his reply 😃

@jeffhollan
Copy link

Can you try (in 16.4.0), after setting the environment variables, clicking "File -> New Project" and going up through the template select screen? When you get to the screen that shows templates you should see a little spinner in the bottom right saying like "Getting latest items..." or something. Wait for it to finish. You can then close the create window and try to run your project. Unfortunately this create flow is the only spot right now to get VS to "check and download" the latest metadata and runtime versions, and worth doing it to make sure it's pulled the latest.

Also good to confirm when it's done and you click refresh you see ".NET Core 3" as one of the options in the template dropdown

@MedAnd
Copy link

MedAnd commented Dec 5, 2019

This is what I see but when loading my project and trying debug still fails with the same issue:

image

PS. I think in your article there is a typo, I think you meant:

Set the environment variable AzureFunctionsHiddenTagsVisible to 1

@jeffhollan
Copy link

Yeah that "Making sure all templates are up to date" should ideally complete and you'd see a lot more templates (like queue and cosmosdb and whatnot). That template metadata also includes the runtime versions VS needs to run

@soninaren
Copy link
Member

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

@wahyuen
Copy link

wahyuen commented Dec 10, 2019

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!

@optiks
Copy link

optiks commented Dec 13, 2019

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....

@brettsam
Copy link
Member

@soninaren / @vijayrkn -- any ideas on this one? Seems like people are hanging while trying to update the templates?

@soninaren
Copy link
Member

@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 is 350 mb (x64) vs 112 mb (x86). This would be the likely reason for hangs.

@optiks and @wahyuen as a workaround can do the following:

  1. delete %userprofile%\.templateengine
  2. delete contents of %userprofile%\AppData\Local\AzureFunctionsTools
  3. download and extract the following zip file into %userprofile%\AppData\Local\AzureFunctionsTools

@matteotumiati
Copy link

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.

@rpannell
Copy link

Been fighting this for days! Between @soninaren and @matteotumiati, I have corrected a few issues with the upgrade to .net core 3. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Jan 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests