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

Dirth, Steven 21 Reputation points
2021-09-02T18:14:31.787+00:00

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.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,029 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,962 questions
{count} votes

Accepted answer
  1. AnuragSingh-MSFT 21,381 Reputation points
    2021-09-08T07:38:30.547+00:00

    Hi @Dirth, Steven ,

    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 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.