Service provider not loaded I have:

services:
  entity.query.external:
    class: Drupal\m_entities\Entity\Query\External\QueryFactory
    arguments: ['@plugin.manager.my_entity_storage_client', '@my_entity.storage_client.response_decoder_factory', '@http_client', '@entity.manager']
    tags:
      - { name: backend_overridable }
  my_entity.storage_client.response_decoder_factory:
    class: Drupal\m_entities\ResponseDecoderFactory
    tags:
      - { name: service_collector, tag: my_entity_response_decoder, call: addDecoder }
  plugin.manager.my_entity_storage_client:
    class: Drupal\m_entities\MyEntityStorageClientManager
    parent: default_plugin_manager
  entity.my_entities.routes:
    class: Drupal\m_entities\Routing\MyEntityRoutes
    arguments: ['@entity.manager']
  access_check.my_entities.add:
    class: Drupal\m_entities\Access\MyEntityAddAccessCheck
    arguments: ['@entity.manager']
    tags:
      - { name: access_check, applies_to: _my_entity_add_access }


but my service provider is not loaded in below code:

ModifyServiceDefinitionsPass

$providers = $kernel-&gt;getServiceProviders('app'); // &lt;-- not loaded in here
foreach ($providers as $provider) {
  if ($provider instanceof ServiceModifierInterface) {
    $provider-&gt;alter($container);
  }
}


how to make a service provider loaded?
services.yml files are not service providers.

ServiceProviders are to dynamically add or modify service definitions, a yml file is just content that's parsed and merged together with everything else.

If that's not loaded then my guess is that you named it incorrectly, but you didn't include the filename, please add that including the other files you have, specifically the info.yml file.