question

DirthSteven-5159 avatar image
0 Votes"
DirthSteven-5159 asked AnuragSingh-MSFT commented

Migrating to Dotnet-Isolated Azure Functions worker.config.json was not found

I am currently upgrading an azure functions project to dotnet 5. However, at some point I began having this error, and even doing a git reset --hard back to the last known-working version of the project (on dotnet 5) did not resolve it.

A host error has occurred during startup operation 'a515fa31-c9e5-466f-90f2-74916746168a'.
[2021-09-02T16:59:04.983Z] Microsoft.Azure.WebJobs.Extensions.FunctionMetadataLoader: The file '-SNIP-\bin\output\worker.config.json' was not found.
Value cannot be null. (Parameter 'provider')


I checked \bin\output and there is in fact no worker.config.json file.

The problem persists using Visual Studio 2019 to launch the project AND when using func host start --verbose --csharp

I have dotnet SDKs 3.1.412 and 5.0.400 installed.

dotnet-csharpazure-functions
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yes, I am targeting v3.

0 Votes 0 ·

1 Answer

AnuragSingh-MSFT avatar image
2 Votes"
AnuragSingh-MSFT answered AnuragSingh-MSFT commented

Hi @DirthSteven-5159,

I tried to repro this locally but was not able to get the exact error. However, here are some of the action plans that should help you with the issue.

  1. In my test repro, I can see worker.config.json available in the ..\bin[Release|Debug]\net5.0 folder. Do you have this file in this location as well? What is the content of this file?

  2. Do you see the same issue with a newly created .NET 5 isolated function app?


Additionally, you may try the following for this issue:
a. Please ensure that the following packages are referenced in the .csproj file:

 <PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.1.0" />
 <PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.0.4" OutputItemType="Analyzer" />

b. To rule out local nuget cache corruption, clean the local Nuget cache using the steps here. worker.config.json is part of Microsoft.Azure.Functions.Worker.Sdk nuget package. This step should help rectify any corruption due to unexpected edits of this file in the cache.
c. Delete the bin and obj folder from the solution directory.
d. Build and run to see if you are still facing this issue.


Issues related to migration to .NET 5 are also being discussed here on Github.

Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you very much for the detailed post.

Clearing my nuget cache has apparently resolved the problem, but I am now getting a new problem -- "Starting worker process failed The operation has timed out"

0 Votes 0 ·

Thank you @DirthSteven-5159.

The new issue seems to be related to a known bug. More details are available here.
In order to resolve it, please connect to your storage account (I am assuming it's the storage emulator) and clear out the blob contents. This is only observed when debugging .NET 5 isolated function app locally and is not observed when the app is deployed in Azure. More details on the topic has been discussed on this link.

I hope it helps!

0 Votes 0 ·