in src/Google.Cloud.Functions.Hosting/HostingInternals.cs [225:236]
internal static Type FindDefaultFunctionType(params Type[] types)
{
var validTypes = FindValidFunctionTypes(types);
return validTypes.Count switch
{
0 => throw new ArgumentException("No valid Cloud Function types found."),
1 => validTypes[0],
_ => throw new ArgumentException(
$"Multiple Cloud Function types found. Please specify the function to run via the command line or the {EntryPoint.FunctionTargetEnvironmentVariable} environment variable."),
};
}