The accepted and other answers did not work for me.
SOLUTION
The solution for me was to delete the whole dependencies folder in "C:\Users{your name}.azurelogicapps\dependencies"
Then when you restart visual studio code, the extension should automatically install the latest dependencies.
ISSUE EXPLANATION
The issue was caused by having an older version of Azure Function Tools, but when I executed the "func --version", it gave me the latest version. I had two installations on my PC.
My visual studio code extension went to another function core Tools installation located in "C:\Users{your name}.azurelogicapps\dependencies\FuncCoreTools\func.exe".
I checked this version:
- by right clicking on the func.exe file
- properties -> details
Here I found the older version that was executed when I ran my application.
I tried editing it in visual studio code by:
- file -> preferences -> settings -> extensions -> logic app standard
and alter the file path for the dependencies to go to the
"C:\Program Files\Microsoft\Azure Functions Core Tools\func.exe" version which was the latest version.
That didn't work, deleting the dependencies folder did.