Reputation: 798
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:\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.
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?
Upvotes: 8
Views: 21508
Reputation: 191
I Deleted AzureFunctionsTools and azure-functions-core-tools from C:\Users\ {YourUser} \AppData\Local
. And ran the solution again it downloaded the same tools and then executed without errors.
Upvotes: 18
Reputation: 18946
In my similar case after installing Visual studio 2019 16.11.2 in a new Win 10 S.
C:\Users\[username]\AppData\Local\AzureFunctionsTools\Releases\3.23.5\cli_x64
Upvotes: 3
Reputation: 20141
What worked for me is combination of above two answers .
Same error I also faced due to anti-virus but can't modify anti-virus since it can be changed by IT Security/networking team and process is time-taking & long process. Another workaround is :
Install azure-functions-core-tools
via npm
npm install -g azure-functions-core-tools@3
Change Executable & Working Directory in Debug settings for azure Project settings
Working Directory : C:\<Project path>\bin\Debug\netcoreapp3.1
Executable : C:\Users\<username>\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\func.exe
Upvotes: 0
Reputation: 571
I was just having on a fresh install of Visual Studio 2019 (had to uninstall 2017), and it was irritating me to no end.
I have found a solution to the problem, but no reason as to why this problem happened nor why Visual Studio deemed it necessary to make it so hard to fix things (they have no option of installing or reinstalling Azure Functions Tools in VS 2019 or even outside of it).
Solution:
Find a way to download the release. I used npm: npm install -g azure-functions-core-tools@3
(-g
is global but you can install it locally, @3
will install the latest 3.x.x)
Replace the entire contents of C:\Users\<username>\AppData\Local\AzureFunctionsTools\Releases\3.4.1\cli_x64
with the version you installed.
For me, it was all the files in \node_modules\azure-functions-core-tools\bin
.
Upvotes: 0
Reputation: 1143
I am able to get this working just by targeting .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
.
Upvotes: 2
Reputation: 24549
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:\Users\{userName}\AppData\Local\AzureFunctionsTools\Releases
Upvotes: 2
Reputation: 798
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:\Users\xxxx\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\func.exe
I changed Application arguments to start
I changed Working Directory to Sourcedirectory\FunctionApp1\FunctionApp1\bin\Debug\netstandard2.0
I would still love to know where the Project settings were getting their values from though...
Upvotes: 9