尝试从 Visual Studio 2017 本地运行 Azure Function App 会出现“func.exe 不存在”错误

Pau*_*hin 2 c# function azure

我在 Visual Studio 2017(我刚刚更新到 v15.8.4)中创建了一个带有 Http 触发器的新 Azure 函数应用程序。使用生成的函数,当我尝试运行它时,我只会收到一个带有错误的消息框

The debug executable "C:\Users\Paul\AppData\Local\AzureFunctionTools\Releases\2.5.2\cli\func.exe" specified in the 'FunctionApp1' debug profile does not exist.

Sure enough there is no func.exe at that location, just a func.dll.

The file C:\Users\Paul\AppData\Local\AzureFunctionTools\Releases\1.3.0\cli\func.exe does exist.
Run Code Online (Sandbox Code Playgroud)

我之前在本地成功运行了 Azure 函数,但我认为更新 Visual Studio 几次已经破坏了某些东西。我怎样才能让它工作?

小智 8

我从 C:\Users\ {YourUser} \AppData\Local 中删除了 AzureFunctionsTools 和 azure-functions-core-tools。并再次运行解决方案,它下载了相同的工具,然后没有错误地执行。

  • 我删除了该文件夹,然后重新启动 Visual Studio。然后开始调试。这似乎是该走的路! (4认同)

Pau*_*hin 5

我最终通过更改调试屏幕中的设置来实现这一点。

我将 Launch 从 Project 更改为 Executable

我将 Executable 设置为 C:\Users\xxxx\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\func.exe

我将应用程序参数更改为开始

我将工作目录更改为 Sourcedirectory\FunctionApp1\FunctionApp1\bin\Debug\netstandard2.0

我仍然很想知道项目设置从哪里获得它们的值...

调试设置


Tom*_*SFT 2

我怎样才能让它发挥作用?

您的情况似乎没有azure function tools v2,请尝试安装它。

npm i -g azure-functions-core-tools@core --unsafe-perm true
Run Code Online (Sandbox Code Playgroud)

另请尝试将[Azure功能和Web作业工具]更新到最新版本

工具->扩展和更新

在此输入图像描述

然后尝试运行azure功能,如果没有对应的版本会自动下载。

在此输入图像描述

测试结果

在此输入图像描述

更新

从路径中查看功能工具

C:\Users\{userName}\AppData\Local\AzureFunctionsTools\Releases

在此输入图像描述