Migrating Azure Function App From In-Process model to Isolated-Worker model and .NET8

Amr 10 Reputation points
2024-05-31T11:40:42.4133333+00:00

After I migrated my azure function app to isolated-worker model and .net8, I deployed it to the azure and I started to get the following runtime error: Microsoft.Azure.WebJobs.Script: Error configuring services in an external startup class.: Could not load file or assembly 'System.ComponentModel, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

Previously the func app used .NET6 and In-process model.

Also this issue doesn't exist locally.

Here is a snapshot of my csproj.

Note that I added an explicit reference of the pckg System.ComponentModel to my csproj file as you can see in the screenshot.

User's image

User's image

Any ideas what might be the root cause for this issue ?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,911 questions
Developer technologies ASP.NET ASP.NET Core
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Ismail JLL 0 Reputation points
    2024-10-07T14:21:55.06+00:00

    Actually i got it resolved when migrating from In process to Isolated. You need to go to Visual Studio --> Tool --> Options --> Project & Solutions --> Azure functions --> Check for updates.

    But when upgrading .net 6 to .net 8 while still being in In-Process mode of Azure function, i get the same error.

    0 comments No comments

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.