Trying to debug an Azure function .NET STANDARD 2.0 locally. Using Visual Studio 2017 CE. Stuff worked yesterday wonder what have gone wrong. Uninstalled all NET CORE SDK and put back the 2.1.201. Found other solutions about Core 1.1 but no luck with them. When debugging the console shuts down right away and only leaves this error message
The program '[1684] dotnet.exe' has exited with code -2147450750 (0x80008082).
Update
I went to a wrong place before. This problem is not caused by missing .Net Core 2.1. It may be related to Azure Functions and Web Jobs Tools
(on VS menus, Tools>Extensions and Update).
From version of 15.0.40502.0
, the extension consumes a feed which keeps templates, build tools, and the runtime up to date whenever there is a change made in the service.
See %LocalAPPDATA%\AzureFunctionsTools\Releases\2.2.2\manifest.json
.
"CliEntrypointPath": "C:\\Users\\UserName\\AppData\\Local\\AzureFunctionsTools\\Releases\\2.2.2\\cli\\func.exe"
In VS, entry of 2.x cli was always func.dll
before. Eliminating the requirement of .Net Core 2.1 for cli 2.0.1-beta.31(host 2.0.11888), a self contained version(x86) is pushed to VS. Its entry is func.exe
.
If the entry remains to be func.dll
on your x64 platform, error will occur due to running x86 func.dll
with x64 dotnet.
Digging deeper, we can see the following error message
Failed to load the dll from [C:\Users\UserName\AppData\Local\AzureFunctionsTools\Releases\2.2.2\cli\hostpolicy.dll], HRESULT: 0x800700C1
An error occurred while loading required library hostpolicy.dll from [C:\Users\UserName\AppData\Local\AzureFunctionsTools\Releases\2.2.2\cli\]
Solution
If your Azure Functions and Web Jobs Tools
is 15.0.40617
, just change the entry to func.exe
. Then restart VS(necessary step).
If your version is lower, I recommend you to update to 15.0.40617
. After update, delete %LocalAPPDATA%\AzureFunctionsTools
, then create a new Azure Function project, wait at the create dialog for VS to download new cli and template.
After a while, we can see the tip change to
I had an exactly same issue. I installed .NET Core 2.1 SDK, updated Azure Functions and Web Jobs Tools to version 15.0.40617.0 and it still didn't work. I decided to revert Azure Functions and Web Jobs Tools to version 15.0.40608.0 and it works! Additionally, I have version 2.1.301 of .NET Core.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With