Could not load file or assembly ‘Microsoft.Extensions.Primitives, Version=7.0.0.0, Culture=neutral, PublicKeyToken=’. The system cannot find the file specified.

There are several issues / message came when working with the Azure function app, there were common issue related to dependency not found.

Could not load file or assembly ‘System.IdentityModel.Tokens.Jwt after deploying on Azure

When you have build the function app in .net with the dependent or project reference, you came across multiple issues / message when deploy to Azure.

Could not load file or assembly ‘Microsoft.Extensions.Configuration.Abstractions, Version=5.0.0.0 in Azure Functions

The best solution to check the dependency with the current / latest version. In some cases, we need to downgrade Microsoft.Extensions* (in my case Microsoft.Extensions.Logging.Console) from 5.0.0 to 3.1.0 and the error gone 🙂

Also, In some cases, we need to updated / upgraded the packages ( System.IdentityModel.Tokens.Jwt reference via nuget package manager) and it works again 🙂

Upgrade Azure Function from .net Core 3.1 to .net Core 7.0. Error “‘Could not load file or assembly ‘Microsoft.Extensions.Configuration.Abstraction

Another common solution:

  • Unload the current project solution
  • Add the line into .csproject file
  • In the PropertyGroup
  • FunctionsSkipCleanOutput
  • Reload the project
  • Rebuild the project and it works 🙂

Happy Programming!!

Leave a Reply

Discover more from AI Infrastructure Architect & Enterprise Solution Architect

Subscribe now to keep reading and get access to the full archive.

Continue reading