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
using Microsoft.Azure.Functions.Extensions.DependencyInjection;
using MyOpenApiFunctionApp;
[assembly: FunctionsStartup(typeof(Startup))]
namespace MyOpenApiFunctionApp
{
using Microsoft.ApplicationInsights.Channel;
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.Azure.Functions.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
public class Startup : FunctionsStartup
{
public override void Configure(IFunctionsHostBuilder builder)
{
builder.Services.AddSingleton<ITelemetryInitializer, TelemetryInitializer>();
}
}
public class TelemetryInitializer : ITelemetryInitializer
{
public void Initialize(ITelemetry item) { }
}
}
Unable to load one or more of the requested types.
Could not load file or assembly 'Microsoft.ApplicationInsights, Version=2.17.0.146, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at Microsoft.Azure.WebJobs.Extensions.OpenApi.Core.Resolvers.OpenApiConfigurationResolver.Resolve(Assembly assembly)
at Microsoft.Azure.WebJobs.Extensions.OpenApi.OpenApiHttpTriggerContext.get_OpenApiConfigurationOptions()
at Microsoft.Azure.WebJobs.Extensions.OpenApi.OpenApiTriggerFunctionProvider.RenderSwaggerUI(HttpRequest req, ExecutionContext ctx, ILogger log)
The text was updated successfully, but these errors were encountered:
I've faced the same issue. It seems that some of the types in FunctionApp dll cannot be loaded because they depend on types in different assemblies which are not loaded.
I've created a minimal reproduction repository to help maintainers reproduce it.
Adding app insights dependency and a TelemetryInitializer to the app breaks with an error
Steps to reproduce:
Follow the tutorial
Add Application insight packages:
ITelemetryInitializer
The text was updated successfully, but these errors were encountered: