visual studio code - Azure Functions HTTPTrigger running locally with VSCode weird bug but API still works .NET - Stack Overflow

时间: 2025-01-05 admin 业界

To reproduce the problem I'm encountering, it's quite trivial.

  • Go to VSCode.
  • Do >Azure Functions: Create new project
  • Use .NET 8.0 Isolated LTS
  • Use the HTTP trigger template
  • Then just click Enter
  • Run the app with the "Play" button on VSCode (see image below):

I have this in the Output tab:

Activating task providers dotnet
Error: there is no registered task type 'func  C:\Users\[REDACTED]\MyFolder\bin\Debug\net8.0'. Did you miss installing an extension that provides a corresponding task provider?
Activating task providers all
Error: there is no registered task type 'func  C:\Users\[REDACTED]\MyFolder\bin\Debug\net8.0'. Did you miss installing an extension that provides a corresponding task provider?

In the terminal tab, I have:

Functions:

        HttpTrigger1: [GET,POST] http://localhost:7228/api/HttpTrigger1

And I can do a POST request there. So, everything seems to work correctly. However, I have this really weird error message, and I don't like having error messages I don't understand even though everything works.

What seems to be the problem?

Additional details about my VSCode:

Version: 1.96.2 (user setup)
Commit: fabdb6a30b49f79a7aba0f2ad9df9b399473380f
Date: 2024-12-19T10:22:47.216Z
Electron: 32.2.6
ElectronBuildId: 10629634
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.22631

I have 8.0.401 [C:\Program Files\dotnet\sdk] and the Azure Functions Core Tools (4.0.6610) installed:

Screenshot of the Visual Studio "Terminal" tab (and I can do POST request to that localhost address):

Screenshot of the Visual Studio "output" Tab:

I have the Azure Functions extension installed.

To reproduce the problem I'm encountering, it's quite trivial.

  • Go to VSCode.
  • Do >Azure Functions: Create new project
  • Use .NET 8.0 Isolated LTS
  • Use the HTTP trigger template
  • Then just click Enter
  • Run the app with the "Play" button on VSCode (see image below):

I have this in the Output tab:

Activating task providers dotnet
Error: there is no registered task type 'func  C:\Users\[REDACTED]\MyFolder\bin\Debug\net8.0'. Did you miss installing an extension that provides a corresponding task provider?
Activating task providers all
Error: there is no registered task type 'func  C:\Users\[REDACTED]\MyFolder\bin\Debug\net8.0'. Did you miss installing an extension that provides a corresponding task provider?

In the terminal tab, I have:

Functions:

        HttpTrigger1: [GET,POST] http://localhost:7228/api/HttpTrigger1

And I can do a POST request there. So, everything seems to work correctly. However, I have this really weird error message, and I don't like having error messages I don't understand even though everything works.

What seems to be the problem?

Additional details about my VSCode:

Version: 1.96.2 (user setup)
Commit: fabdb6a30b49f79a7aba0f2ad9df9b399473380f
Date: 2024-12-19T10:22:47.216Z
Electron: 32.2.6
ElectronBuildId: 10629634
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.22631

I have 8.0.401 [C:\Program Files\dotnet\sdk] and the Azure Functions Core Tools (4.0.6610) installed:

Screenshot of the Visual Studio "Terminal" tab (and I can do POST request to that localhost address):

Screenshot of the Visual Studio "output" Tab:

I have the Azure Functions extension installed.

Share Improve this question edited Dec 24, 2024 at 8:35 FluidMechanics Potential Flows asked Dec 23, 2024 at 19:25 FluidMechanics Potential FlowsFluidMechanics Potential Flows 6161 gold badge22 silver badges42 bronze badges 1
  • The error message indicates that VSCode cannot find a registered task type for the Azure Functions runtime environment. Check the Azure Functions Core Tools installed correctly or not. install azure function latest version by using npm install -g azure-functions-core-tools@4 --unsafe-perm true – Pavan Commented Dec 24, 2024 at 2:24
Add a comment  | 

1 Answer 1

Reset to default 0

The error indicates that Azure Functions is unable to recognize the task type 'func C:\Users\[REDACTED]\MyFolder\bin\Debug\net8.0'. This could be caused by missing extensions.

  • You can check which versions of .NET SDK are installed by running the command dotnet --list-sdks
  • Ensure that you have the .NET 8 SDK installed.
  • If you’re using the Azure Functions Core Tools locally, make sure should be up to date. You can update it using this command: npm install -g azure-functions-core-tools@4

I have created the Http trigger function with runtime stack .NET 8.0 isolated in visual studio code followed by same instructions which you mentioned. The function ran successfully. check below:

.cs proj:

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <AzureFunctionsVersion>v4</AzureFunctionsVersion>
    <OutputType>Exe</OutputType>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <RootNamespace>New_folder__4_</RootNamespace>
  </PropertyGroup>

Output:

最新文章