This post was most recently updated on July 26th, 2024.
2 min read.Well, that title is a mouthful. But it’s the topic for today, so what can you do?
That said, this article should be pretty topical, as the issue started popping up only a few days ago. Chances are it’ll be patched soon enough, but in the meantime, it’s always useful to document the fix!
Problem
When running or debugging Azure Functions locally, your runtime just blurts our this error and fails to compile your functions:
[2021-01-11T10:28:11.495Z] A host error has occurred during startup operation '0d00defa-b8bd-4fb8-9794-b0e5950a4c38'. [2021-01-11T10:28:11.499Z] System.IO.FileSystem: Could not find a part of the path 'C:\Users\username\AppData\Local\AzureFunctionsTools\Releases\3.17.0\workers'. Value cannot be null. (Parameter 'provider') Press any to continue….[2021-01-11T10:28:12.625Z] A host error has occurred during startup operation 'beca4180-a97c-4fab-b3d8-2323dbf5512d'. [2021-01-11T10:28:12.628Z] System.IO.FileSystem: Could not find a part of the path 'C:\Users\username\AppData\Local\AzureFunctionsTools\Releases\3.17.0\workers'. [2021-01-11T10:28:14.762Z] A host error has occurred during startup operation '447864ad-026f-462d-9d8d-70f95703baa8'. [2021-01-11T10:28:14.764Z] System.IO.FileSystem: Could not find a part of the path 'C:\Users\username\AppData\Local\AzureFunctionsTools\Releases\3.17.0\workers'.
And this is what it actually looks like:
What do?
Solution
This one turned out to be easy to fix. Let me show the steps below!
Time needed: 5 minutes
How to fix “System.IO.FileSystem: Could not find a part of the path \AppData\Local\AzureFunctionsTools\Releases\3.17.0\workers. Value cannot be null. (Parameter ‘provider’)” when running Azure Functions locally?
- Copy-paste the path the CLI is complaining about
That’s going to be something along the lines of:
‘C:\Users\your username here\AppData\Local\AzureFunctionsTools\Releases\3.17.0\workers - Remove the last part (workers) and open the directory in File Explorer
The screenshot below shows what you should see – the “workers” folder really does not exist.
- Create a new folder called “workers”
It doesn’t matter if it’s empty. No need to copy anything over from previous AzureFunctionsTools (although you can if you really want to). You just need a new empty folder named “workers”.
Like in the screenshot below: - Run your functions again
It should now work – like magic :)
And there we go – you should be good (for now).
Did it work for you? Let me know in the comments -section below!
References
- “Azure Functions local debugging broke with 3.17.0 update” 🙃
- Search (and secretly, sync) broken in OneNote? A quick fix! - September 3, 2024
- “Destination Path Too Long” when copying files in File Explorer? Easy workaround(s)! - August 27, 2024
- Where does NetSpot (wifi heatmapping tool) store its project files? - August 20, 2024