I’m working in a virtual environment in VS Code and I can’t understand why I’m getting this error:
[2022-07-19T10:00:31.580Z] A host error has occurred during startup operation '609dfded-e9f5-4fc4-b3a3-554bde11a415'.
[2022-07-19T10:00:31.582Z] Microsoft.Azure.WebJobs.Extensions.Http: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
Value cannot be null. (Parameter 'provider')
What should I check?
12
Answers
My solution to this issue was to go into Windows Defender and exclude:
I then reinstalled Azure Functions Core Tools v4 and everything worked as intended.
Ps. After excluding make sure to give time for your system to update. I restarted and all worked as intended. Hope this helps someone.
I had this exact issue until Yesterday when I tried updating Azure Function Core Tools (https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=v4%2Cwindows%2Ccsharp%2Cportal%2Cbash) That resolved the problem, and I now am able to run my function’s project using the CLI
I had this issues as well, and my solution was to re-download and re-install the Azure Function Core Tools. I think installing twice fixed the issue for me.
For me, relaunching Azure Functions Core Tools installer and choose repair fixed the issue. I had been encountering this issue in the last two days and it’s really annoying.
Rolled back nuget package Microsoft.NET.Sdk.Functions from 4.1.3 to 4.1.1 on the Azure functions Api project.
Rebuild solution.
I believe the cause is that the Azure Functions Core Tools (henceforth AFCT) that Visual Studio (or VS Code) uses does not have the proper version of Microsoft.Azure.WebJobs.Extensions.Http.dll. Installing AFCT doesn’t affect anything directly, because VS uses its own version stored elsewhere. My strategy was to install the latest AFCT version and point VS to that new version.
These instructions are for x64 Windows.
Move old AFCT, point VS at new version
We encountered a similar problem after updating
Microsoft.Azure.WebJobs.Extensions.Http
to3.2.0
Developers using Rider had no problems but no Visual Studio users could run our project.
This post explained it for us: https://weblogs.asp.net/sfeldman/updating-azure-functions-tools.
Just by creating a new azure functions project, the latest version for AzureFunctionsTools was downloaded to
AppDataLocalAzureFunctionsTools
.Then we could run the project without errors.
This fixed it for me, hope it helps someone else
Taken from
Unable to upgrade Azure Functions Core Tools, Exception "Cannot create instance of type 'NuGet.Versioning.VersionRange'"
The accepted answer didn’t totally fix the issue for me, but I did find that the package Microsoft.NET.Sdk.Functions(4.1.3) does cause the issue, but I found another one does as well, so it will depend on what other packages you have in your app.
So, start with downgrading that package to (4.1.1), if that doesn’t fix the issue, downgrade all packages and upgrade them one by one and try running the app after each upgrade.
In my case the other package that was causing the issue along with the above package was Microsoft.Extensions.Http.Polly(7.0.0), the highest that worked for me was (6.0.11)
In my case i just executed this command in my vs code project where the tool i would use was the v4 :
npm install -g azure-functions-core-tools@4 --unsafe-perm true
You can check your machine and use the latest version of azure-functions-coretools.
For those are using Rider, go to settings > tools > Azure > Functions > Upgrade your tools to latest one (the version 4.0.4785 fixed my issue).
Probably not the correct/enterprise way to fix this but I got it working by backing up the contents of folder
And replacing with the contents of
Restarted VS, cleaned and re ran the solution and worked straight away.
Pls note this was for a personal project, I’m an ex full time/pro coder and this was just causing me a headache.
I can’t guarantee it will work for all