azure-functions-core-tools icon indicating copy to clipboard operation
azure-functions-core-tools copied to clipboard

NODE.JS - Microsoft.Azure.WebJobs.Extensions.Http: Could not load file or assembly

Open GregorieCalderon opened this issue 2 years ago • 5 comments

I created a new azure function (which has been successful using VSCode AZ extension) but when trying to run the function i get error:

Microsoft.Azure.WebJobs.Extensions.Http: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.8.0, Culture=neutral, PublicKeyToken=TOKEN'

I have confirmed the most recent version of azure-functions-core-tools is installed (4.0.5148) I have also uninstalled and reinstalled core-tools to ensure any corrupted files have been removed.

This is a NODE.JS project that does not reference any 'System.Net', i deleted node_modules and reinstalled it as well with no luck.

image

GregorieCalderon avatar Jun 06 '23 00:06 GregorieCalderon

After some more investigation, it seems like the extension "Azure Functions" is causing issues.

I get a pop up saying:

Update your Azure Functions Core Tools (4.0.5148) to the latest (4.0.5198) for the best experience. image

When clicking "Update" , all installs well (at least i think) no errors pop up. image

Then once i restart VSCode, the error pop up again. As if i never did the update. image

I have tried removing the plugin from VSCode and re-instaling with no luck. I even uninstalled VSCode and reinstalled everything with no luck....

This seems to be an ongoing issue, the solution provided here did not work for me: https://github.com/Azure/azure-functions-core-tools/issues/2514

GregorieCalderon avatar Jun 06 '23 04:06 GregorieCalderon

It seems the only way to solve this issue on my end was to download the update using the command line and choco. I used command

choco install azure-functions-core-tools

This does not solve the underlying issue.

GregorieCalderon avatar Jun 06 '23 17:06 GregorieCalderon

I installed the core tools using winget install Microsoft.Azure.FunctionsCoreTools and I'm running into this issue.

demoray avatar Jul 24 '23 20:07 demoray

This is due to conflicting installations, fix is to delete the below folder:

C:\Users***\AppData\Local\AzureFunctionsTools

yashints avatar Apr 04 '24 21:04 yashints

This is due to conflicting installations, fix is to delete the below folder:

C:\Users***\AppData\Local\AzureFunctionsTools

Unfortunately I still get the error even if I discard the AzureFunctionsTools folder, although due to the lapse of time with different version numbers: "Update your Azure Functions Core Tools (4.0.5907) to the latest (4.0.6280) for the best experience." Incidentally, I also deleted

  • C:\Users<username>.vscode\extensions\ms-azuretools.vscode-azurefunctions-1.15.4
  • C:\Users<username>\AppData\Roaming\Code\CachedExtensionVSIXs\ms-azuretools.vscode-azurefunctions-1.15.4

(In the past I solved a similar issue with the VS Logic App extension by deleting the corresponding files).

npm i -g azure-functions-core-tools@4 --unsafe-perm true and/or npm install -g azure-functions-core-tools@4 seem to work, but after a while the message pops up again.

This is rather annoying as it took up quite a bit of time. I will now see if I can get this to work by using the .msi (This seems to be the case; with the msi upgrading works fine).

FerryMan-Coder avatar Oct 17 '24 11:10 FerryMan-Coder