Trying to run an Azure Function App locally from Visual Studio 2017 gives a 'func.exe does not exist' error
Trying to run an Azure Function App locally from Visual Studio 2017 gives a 'func.exe does not exist' error
I have created a new Azure Function app with an Http Trigger in Visual Studio 2017 (which I have just updated to v15.8.4).
Using the generated function, when I try to run it I just get a message box with the error
The debug executable "C:UsersPaulAppDataLocalAzureFunctionToolsReleases2.5.2clifunc.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:UsersPaulAppDataLocalAzureFunctionToolsReleases1.3.0clifunc.exe does exist.
I have successfully run an Azure function locally before but I assume updating Visual Studio a few times has broken something.
How can I get this working?
3 Answers
3
I eventually got this to work by changing the settings in the Debug screen.
I changed Launch from Project to Executable
I set Executable to C:UsersxxxxAppDataRoamingnpmnode_modulesazure-functions-core-toolsbinfunc.exe
I changed Application arguments to start
I changed Working Directory to SourcedirectoryFunctionApp1FunctionApp1binDebugnetstandard2.0
I would still love to know where the Project settings were getting their values from though...

How can I get this working?
In your case, it seems that there is no azure function tools v2 , please have a try to install it.
npm i -g azure-functions-core-tools@core --unsafe-perm true
Please also try to update the [Azure functions and Web Jobs tools] to latest version
tool->Extensions and updates

And then try to run the azure function, if there is no corrosponding version it will download it automatically.

Test Result

Update
Check the function tools from the path
C:UsersuserNameAppDataLocalAzureFunctionsToolsReleases
C:UsersuserNameAppDataLocalAzureFunctionsToolsReleases

I have followed your instructions - installed the latest azure functions tools 2 and checked I have the latest version of Azure functions and web jobs. Unfortunately I still get the same error. What has been configured to try to run func.exe from a location where it does not exist? What command should be run to run the azure function locally?
– Paul Dolphin
Sep 14 '18 at 19:09
@PaulDolphin Make sure that Azure function tools are updated to the most recent version. We could check the function tools in "C:UserstomsAppDataLocalAzureFunctionsToolsReleases"
– Tom Sun
Sep 17 '18 at 1:12
I have 2.5.2 installed - there are loads of files in that directory but no func.exe for some reason.
– Paul Dolphin
Sep 18 '18 at 8:01
It is very odd that if there is no func.exe file. We could found the func.exe is in the path C:UsersusernameAppDataLocalAzureFunctionsToolsReleases2.5.2cli
– Tom Sun
Sep 18 '18 at 8:27
I am able to get this working just by targeting .Net Standard 2.0.
.Net Standard 2.0
Just change to netstandard2.0 in the project file.
Application Settings

Debug Settings

There is no need of providing a path to the func.dll.
func.dll
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy
Thanks for responding.
– Paul Dolphin
Sep 14 '18 at 19:06