When my Azure Function doesn't build

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?

This post was most recently updated on February 7th, 2021.

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

Table of Contents

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:

"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')" getting thrown when running Azure Functions locally.
“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’)” getting thrown when running Azure Functions locally.

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?

  1. 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

  2. Remove the last part (workers) and open the directory in File Explorer

    This image has an empty alt attribute; its file name is image-8.png

  3. 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”.

    This image has an empty alt attribute; its file name is image-9.png

  4. Run your functions again -> works like magic

And there we go – you should be good (for now)!

References

mm
5 1 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments