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 how it actually looks like:

What do?
Solution
This one turned out to be easy to fix.
Time needed: 2 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
- 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”.
- Run your functions again -> works like magic
And that’s about it!
References
- 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? - January 12, 2021
- How to nuke the Identity Cache in Visual Studio? - January 11, 2021
- Fixing unexpected Microsoft.AspNetCore package errors after a dependency update - January 6, 2021