in src/Google.Cloud.Functions.Hosting/HostingInternals.cs [102:113]
private static IApplicationBuilder ValidateStartupClasses(IApplicationBuilder app)
{
var functionType = app.ApplicationServices.GetRequiredService<FunctionTypeProvider>().FunctionType;
var actualStartupClasses = app.ApplicationServices.GetServices<FunctionsStartup>().Select(startup => startup.GetType()).ToList();
var startupClassesFromFunctionTarget = FunctionsStartupAttribute.GetStartupTypes(functionType.Assembly, functionType);
if (!actualStartupClasses.SequenceEqual(startupClassesFromFunctionTarget))
{
throw new InvalidOperationException("Mismatch in startup classes. See https://github.com/GoogleCloudPlatform/functions-framework-dotnet/blob/main/docs/customization.md#specifying-a-functions-startup-class");
}
return app;
}