Hi, while running my azure functions, I am getting this exception in startup class. Even after installing this package error persist.
System.IO.FileNotFoundException: 'Could not load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.'
this is my startup class
#region Dependency
using Microsoft.Azure.Functions.Extensions.DependencyInjection;
#endregion
[assembly: FunctionsStartup(typeof(HROne.Events.FunctionApp.Startup))]
namespace HROne.Events.FunctionApp;
public class Startup : FunctionsStartup
{
public override void Configure(IFunctionsHostBuilder builder)
{
FunctionsHostBuilderContext context = builder.GetContext();
builder.Services.RegisterApplicationServices(context.ApplicationRootPath);
}
}
Any help!

Daniel WrightPosted Apr 9, 2025, 6:34 AM
I see that you are encountering a "Could not load file or assembly" issue in your Azure Functions startup class related to the missing assembly 'Microsoft.Extensions.Configuration.Abstractions' with a specific version. This typically occurs when the required assembly is not present or not referenced correctly, even after package installation.
To address this problem, you can try the following steps:
1. Check Package Installation:
Ensure that the 'Microsoft.Extensions.Configuration.Abstractions' package is correctly installed in your project. You can verify this by checking your project's dependencies or directly in your project file (csproj).
2. Update Package Version:
If the specified version '9.0.0.0' is causing the problem, try updating the package version to a more recent one. This can be done by modifying the package version in your project file or using the NuGet Package Manager to find and install the correct version.
3. Assembly Binding Redirect:
You can add assembly binding redirects in your Azure Functions project to redirect the runtime to the correct version of the assembly it is looking for. This can be done by modifying the `app.config` or `web.config` file within your project.
4. Check Project References:
Ensure that the project references are correctly pointing to the installed package. If not, you can manually add the reference by right-clicking on References in your project and selecting "Add Reference".
5. Clean and Rebuild:
Sometimes, simply cleaning and rebuilding your project can help resolve assembly loading issues. This ensures that the latest references and packages are properly included in the build.
By following these steps, you should be able to resolve the 'Could not load file or assembly' error in your Azure Functions startup class. If the issue persists, consider checking for any additional dependencies or conflicts in your project that might be causing the problem.