I'm getting a runtime error in my functions app but only in Azure, locally everything works fine and neither any issues in my Azure DevOps pipeline.

Bjorn Lenoir 20 Reputation points
2024-07-02T18:54:52.1366667+00:00

The error I'm getting is: Microsoft.Azure.WebJobs.Script: Error building configuration in an external startup class. StoringenDWG.Functions: Could not load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

I started getting this error when upgrading from .NET 6 to .NET 8 and upgrading all the nuget packages inside my project. I even explicitly added the Microsoft.Extensions.Configuration.Abstractions 8.0.0.0 nuget package to my project file but it doesn't change anything. I've tried a lot of things but nothing seems to work.

I also checked all my dependencies but they all use the 8.0.0.0 version of Microsoft.Extensions.Configuration.Abstractions.

Downgrading the packages isn't a good solution and there must be a reason for it not worrking in Azure but locally it does.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,073 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,905 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jaliya Udagedara 2,821 Reputation points MVP
    2024-07-02T20:49:30.0033333+00:00

    Please ensure you have the following app settings. Most importantly FUNCTIONS_INPROC_NET8_ENABLED

      {
        "name": "FUNCTIONS_EXTENSION_VERSION",
        "value": "~4",
        "slotSetting": false
      },
      {
        "name": "FUNCTIONS_INPROC_NET8_ENABLED",
        "value": "1",
        "slotSetting": false
      },
      {
        "name": "FUNCTIONS_WORKER_RUNTIME",
        "value": "dotnet",
        "slotSetting": false
      }
    

    Reference:
    https://learn.microsoft.com/en-us/azure/azure-functions/functions-dotnet-class-library?tabs=v4%2Ccmd#updating-to-target-net-8

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