You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue has been transferred from the Azure SDK for .NET repository, #37271.
Please be aware that @Prince269090 is the author of the original issue and include them for any questions or replies.
Details
Library name and version
Microsoft.NET.Sdk.Functions" Version="4.2.0
Describe the bug
I have function app with below packages and files. and i am always getting error during run.
[assembly:FunctionsStartup(typeof(Startup))]namespaceSampleErrors{/// <summary>/// A class that inherits from FunctionsStartup and overrides the methods to configure the app and the host for Azure Functions./// </summary>publicclassStartup:FunctionsStartup{/// <summary>/// Configures the app configuration using the given builder./// </summary>/// <param name="builder">The functions configuration builder.</param>publicoverridevoidConfigureAppConfiguration(IFunctionsConfigurationBuilderbuilder){}/// <summary>/// Configures the host using the given builder./// </summary>/// <param name="builder">The functions host builder.</param>publicoverridevoidConfigure(IFunctionsHostBuilderbuilder){varconfigurationBuilder=new ConfigurationBuilder().SetBasePath(Environment.CurrentDirectory).AddEnvironmentVariables();varlocation=string.IsNullOrEmpty(Environment.GetEnvironmentVariable(ConfigurationConstants.LOCATION))?string.Empty
: Environment.GetEnvironmentVariable(ConfigurationConstants.LOCATION);varenvironment=string.IsNullOrEmpty(Environment.GetEnvironmentVariable(ConfigurationConstants.ASPNETCORE_ENVIRONMENT))? ConfigurationConstants.ENVIRONMENT_UAT
: Environment.GetEnvironmentVariable(ConfigurationConstants.ASPNETCORE_ENVIRONMENT);
configurationBuilder.AddJsonFile($"{ConfigurationConstants.APPSETTINGS}.{environment}{location}.json", optional:true, reloadOnChange:true);
#if DEBUG
configurationBuilder.AddJsonFile($"appsettings.json", optional:true);
#endif
varconfiguration= configurationBuilder.Build();
builder.Services.AddSingleton(configuration);
builder.Services.AddLogging();
builder.Services.AddTransient<Function1>();}}}
[2023-06-28T12:51:16.695Z] A host error has occurred during startup operation 'c107b0b5-9651-48c1-8234-b5668db91149'.
[2023-06-28T12:51:16.700Z] Microsoft.Azure.WebJobs.Script: Error configuring services in an external startup class. SampleErrors: Could not load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
Reproduction Steps
Create function app with the files given and when we run its giving issue. its in .net 6
Environment
.net 6
Visual studio 2022
OS : Windows 11
The text was updated successfully, but these errors were encountered:
Issue Transfer
This issue has been transferred from the Azure SDK for .NET repository, #37271.
Please be aware that @Prince269090 is the author of the original issue and include them for any questions or replies.
Details
Library name and version
Microsoft.NET.Sdk.Functions" Version="4.2.0
Describe the bug
I have function app with below packages and files. and i am always getting error during run.
Function
Packages
Expected behavior
It should run without issue or error
Actual behavior
Error
[2023-06-28T12:51:16.695Z] A host error has occurred during startup operation 'c107b0b5-9651-48c1-8234-b5668db91149'.
[2023-06-28T12:51:16.700Z] Microsoft.Azure.WebJobs.Script: Error configuring services in an external startup class. SampleErrors: Could not load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
Reproduction Steps
Create function app with the files given and when we run its giving issue. its in .net 6
Environment
.net 6
Visual studio 2022
OS : Windows 11
The text was updated successfully, but these errors were encountered: