Skip to content

Azure function integration: An error occurred trying to start process 'func' with working directory 'bin\Debug\net9.0\'. The system cannot find the file specified. #7010

Open

Description

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Aspire cannot seem to find the func command from Azure Functions Core Tools on Windows 10.

Expected Behavior

No response

Steps To Reproduce

  • Repro possible with basic Aspire starter project + one azure function added with AddAzureFunctionsProject.
  • Azure function core tools installed with npm i -g azure-functions-core-tools@4 --unsafe-perm true, so func is added to path (works fine in terminal)

Exceptions (if any)

 Unhandled exception: System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'func' with working directory 'bin\Debug\net9.0\'. The system cannot find the file specified.
    at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    at Microsoft.DotNet.Cli.Utils.Command.Execute(Action`1 processStarted)
    at Microsoft.DotNet.Tools.Run.RunCommand.Execute()
    at System.CommandLine.Invocation.InvocationPipeline.Invoke(ParseResult parseResult)
    at System.CommandLine.ParseResult.Invoke()
    at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)

.NET Version info

 Version:           9.0.100
 Commit:            59db016f11
 Workload version:  9.0.100-manifests.1e472b70
 MSBuild version:   17.12.7+5b8665660

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19045
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\9.0.100\

.NET workloads installed:
 [android]
   Installation Source: SDK 9.0.100, VS 17.1.31911.260
   Manifest Version:    35.0.24/9.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.android\35.0.24\WorkloadManifest.json
   Install Type:              Msi

 [aspire]
   Installation Source: SDK 9.0.100
   Manifest Version:    8.2.2/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.2.2\WorkloadManifest.json
   Install Type:              Msi

 [ios]
   Installation Source: SDK 9.0.100, VS 17.1.31911.260
   Manifest Version:    18.2.9170/9.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.ios\18.2.9170\WorkloadManifest.json
   Install Type:              Msi

 [maccatalyst]
   Installation Source: SDK 9.0.100, VS 17.1.31911.260
   Manifest Version:    18.2.9170/9.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maccatalyst\18.2.9170\WorkloadManifest.json
   Install Type:              Msi

 [maui-android]
   Installation Source: SDK 9.0.100, VS 17.1.31911.260
   Manifest Version:    9.0.0/9.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maui\9.0.0\WorkloadManifest.json
   Install Type:              Msi

 [maui-ios]
   Installation Source: SDK 9.0.100, VS 17.1.31911.260
   Manifest Version:    9.0.0/9.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maui\9.0.0\WorkloadManifest.json
   Install Type:              Msi

 [maui-maccatalyst]
   Installation Source: SDK 9.0.100, VS 17.1.31911.260
   Manifest Version:    9.0.0/9.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maui\9.0.0\WorkloadManifest.json
   Install Type:              Msi

 [maui-windows]
   Installation Source: SDK 9.0.100, VS 17.1.31911.260
   Manifest Version:    9.0.0/9.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maui\9.0.0\WorkloadManifest.json
   Install Type:              Msi

Configured to use loose manifests when installing new manifests.

Host:
  Version:      9.0.0
  Architecture: x64
  Commit:       9d5a6a9aa4

.NET SDKs installed:
  3.1.426 [C:\Program Files\dotnet\sdk]
  5.0.100 [C:\Program Files\dotnet\sdk]
  5.0.104 [C:\Program Files\dotnet\sdk]
  6.0.100 [C:\Program Files\dotnet\sdk]
  6.0.136 [C:\Program Files\dotnet\sdk]
  7.0.120 [C:\Program Files\dotnet\sdk]
  8.0.111 [C:\Program Files\dotnet\sdk]
  9.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  arm64 [C:\Program Files\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\arm64\InstallLocation]
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

Anything else?

AppHost package versions:

<PackageReference Include="Aspire.Hosting.AppHost" Version="9.0.0" />
        <PackageReference Include="CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps" Version="9.1.0" />
        <PackageReference Include="Aspire.Hosting.Azure.Functions" Version="9.0.0-preview.5.24551.3"/>

Activity

  1. captainsafia commented on Jan 2, 2025

    @captainsafia
    Contributor

    Dante De Ruwe (@DanteDeRuwe) Thanks for filing this issue!

    Are you attempting to launch the application from Visual Studio? If so, you may need to install Azure Tooling for VS per the instructions in this page. Visual Studio doesn't resolve the local Functions host from the npm-installed directory and relies on the version provided by the VS workloads.

  2. added
    azure-functions
    area-integrations
    azure
    on Jan 2, 2025
  3. DanteDeRuwe commented on Jan 4, 2025

    @DanteDeRuwe
    Author

    Hi Safia Abdalla (@captainsafia), thanks for your swift response! I am running the aspire host project from the CLI with dotnet run --project <aspire-host-project-name>.

    I am a Jetbrains Rider user; running it from inside that IDE gives another weird error that is documented here and also here with a comment from you

    I could install VS to see if that resolves it, but I'm pretty sure it should be the case that Aspire works ootb with the dotnet CLI, no?

  4. captainsafia commented on Jan 6, 2025

    @captainsafia
    Contributor

    Dante De Ruwe (@DanteDeRuwe) Thanks for the additional info.

    The CLI issue might be the easier one to investigate since there are less moving parts there. For editor-based scenarios, the editor's Azure Functions integration comes into play when coordinating the launching of the host.

    Some questions to help debug:

    • What output is printed when you run func --version?
    • Are you able to successfully run this project? It should be the same repro steps and runs locally as me. That will help is figure out if it is a local issue.
    • Did dotnet build on your project succeed without any errors?
  5. added
    needs-author-action
    on Jan 15, 2025
  6. DanteDeRuwe commented on Jan 17, 2025

    @DanteDeRuwe
    Author

    I will take a look at this soon. Thanks for your patience in advance

  7. removed
    needs-author-action
    on Jan 17, 2025
  8. DanteDeRuwe commented on Feb 2, 2025

    @DanteDeRuwe
    Author

    Hi Safia Abdalla (@captainsafia),

    • func --version returns 4.0.6610
    • build has no errors
    • If i do dotnet run on the aspire host of your repro project, it has the same issue:

    Image

    Image

  9. mattchenderson commented on Feb 14, 2025

    @mattchenderson
    Member

    This sounds likely related to Azure/azure-functions-dotnet-worker#2884. It seems like the issue can be reproduced consistently when the Core Tools is installed via NPM, but installing from other channels may work.

  10. ormasoftchile commented on Jul 6, 2025

    @ormasoftchile

    I am seeing the same error. Safia Abdalla (@captainsafia) do you have any update? I cloned the repo you referenced. My results are also erroring:

    Image

    Console log:

    Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler: Error: run session could not be started: IDE returned a response indicating failure {"Executable": {"name":"functions-ebhamket"}, "Reconciliation": 29, "Status": "500 Internal Server Error", "Body": "There is no Functions runtime available that matches the version specified in the project."}

    Do you know of any update?

    Visual Studio 17.14.7

    func --version
    4.0.7317

    dotnet --list-sdks
    9.0.301 [C:\Program Files\dotnet\sdk]

  11. ormasoftchile commented on Jul 6, 2025

    @ormasoftchile

    I am seeing the same error. @captainsafia do you have any update? I cloned the repo you referenced. My results are also erroring:

    Image Console log:

    Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler: Error: run session could not be started: IDE returned a response indicating failure {"Executable": {"name":"functions-ebhamket"}, "Reconciliation": 29, "Status": "500 Internal Server Error", "Body": "There is no Functions runtime available that matches the version specified in the project."}

    Do you know of any update?

    Visual Studio 17.14.7

    func --version 4.0.7317

    dotnet --list-sdks 9.0.301 [C:\Program Files\dotnet\sdk]

    Have to add that after reinstalling Azure core tools using MSI (originally had npm installation), I am able to run from visual studio code. Running from Visual Studio still fails.

  12. captainsafia commented on Jul 28, 2025

    @captainsafia
    Contributor

    Cristián Ormazábal (@ormasoftchile) Based on the description of your issue, can you try seeing if the Azure Functions tooling installed on your Visual Studio is up to date? You should be able to verify this by searching for Azure Functions in your VS settings.

  13. Mivaweb commented on Jul 30, 2025

    @Mivaweb

    I am also facing the same issue. Running from Visual Studio with F5 works as expected. Running from command line using dotnet run on the AppHost results in the Function not beeing started.

    Unhandled exception: An error occurred trying to start process 'func' with working directory 'bin\Debug\net8.0\'. The system cannot find the file specified.

    I can confirm that the azure core tools are installed and that func --version works.

  14. davidfowl commented on Oct 25, 2025

    @davidfowl
    Collaborator

    Fabio Cavalcante (@fabiocav) Jake (@JakeRadMSFT) Adam Ratzman (@adamint) Matthew Henderson (@mattchenderson) Phil Henning (@phenning) Can we get someone to look at this issue to understand why functions + aspire is broken in VS code?

  15. antsok commented on Oct 27, 2025

    @antsok

    I have observed this reported issue when func was installed via npm. However, directly running func start failed with the same error as observed in aspire dashboard, so it may not be aspire specific.

    This set of steps resolved it for me:

    • uninstalling the package (npm uninstall -g azure-functions-core-tools@4),
    • manually cleaning up npm caches,
    • installing Function Tools via MSI
    • restarting VS Code
  16. kamranayub commented on Dec 18, 2025

    @kamranayub

    I resolved it by updating the Microsoft.Azure.Functions.Worker to a later version. I guess mine was out of date as this was closed as fixed in this PR: Azure/azure-functions-dotnet-worker#3127

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-integrationsazureazure-functions

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions