diff --git a/core/lib/Drupal/Component/ProxyBuilder/ProxyBuilder.php b/core/lib/Drupal/Component/ProxyBuilder/ProxyBuilder.php
index 373a779..9fe3e29 100644
--- a/core/lib/Drupal/Component/ProxyBuilder/ProxyBuilder.php
+++ b/core/lib/Drupal/Component/ProxyBuilder/ProxyBuilder.php
@@ -26,6 +26,19 @@ public static function buildProxyClassName($class_name) {
   }
 
   /**
+   * Generates the used class-loading function name from a given class name.
+   *
+   * @param $class_name
+   *   The class name of the actual service.
+   *
+   * @return string
+   *   The function name for loading the proxy class.
+   */
+  public static function buildProxyLoadFunctionName($class_name) {
+    return 'drupal_load_proxy__' . self::buildProxyClassName($class_name);
+  }
+
+  /**
    * Builds a proxy class string.
    *
    * @param string $class_name
@@ -128,6 +141,12 @@ public function build($class_name) {
 
     $final_output = $class_documentation . $class_start . "\n{\n\n" . $output . "\n}\n";
 
+    // Wrap class definition into a loading function, so we don't get exceptions
+    // for missing interfaces when the dumped container is loaded. When the
+    // class is instantiated, module namespaces will have been registered and
+    // the respective interfaces will be available via the class auto loader.
+    $final_output = "function {{ load_function_name }}() {\n" . $final_output . "\n}";
+    $final_output = str_replace('{{ load_function_name }}', $this->buildProxyLoadFunctionName($class_name), $final_output);
     $final_output = str_replace('{{ class_name }}', $class_name, $final_output);
     $final_output = str_replace('{{ proxy_class_name }}', $this->buildProxyClassName($class_name), $final_output);
 
diff --git a/core/lib/Drupal/Component/ProxyBuilder/ProxyDumper.php b/core/lib/Drupal/Component/ProxyBuilder/ProxyDumper.php
index 7126062..cdc6e1a 100644
--- a/core/lib/Drupal/Component/ProxyBuilder/ProxyDumper.php
+++ b/core/lib/Drupal/Component/ProxyBuilder/ProxyDumper.php
@@ -49,11 +49,13 @@ public function getProxyFactoryCode(Definition $definition, $id) {
     // ProxyBuilder calls the method with lazy loading disabled.
     $output = <<<'EOS'
         if ($lazyLoad) {
+            {{ load_function_name }}();
             return $this->services['{{ id }}'] = new {{ class_name }}($this, '{{ id }}');
         }
 
 EOS;
     $output = str_replace('{{ id }}', $id, $output);
+    $output = str_replace('{{ load_function_name }}', $this->builder->buildProxyLoadFunctionName($definition->getClass()), $output);
     $output = str_replace('{{ class_name }}', $this->builder->buildProxyClassName($definition->getClass()), $output);
 
     return $output;
diff --git a/core/modules/block/block.services.yml b/core/modules/block/block.services.yml
index df4d0d7..2a789af 100644
--- a/core/modules/block/block.services.yml
+++ b/core/modules/block/block.services.yml
@@ -25,3 +25,4 @@ services:
   block.repository:
     class: Drupal\block\BlockRepository
     arguments: ['@entity.manager', '@theme.manager', '@context.handler']
+    lazy: true
diff --git a/core/modules/update/update.services.yml b/core/modules/update/update.services.yml
index c14b8cc..b826e22 100644
--- a/core/modules/update/update.services.yml
+++ b/core/modules/update/update.services.yml
@@ -7,9 +7,12 @@ services:
   update.manager:
     class: Drupal\update\UpdateManager
     arguments: ['@config.factory', '@module_handler', '@update.processor', '@string_translation', '@keyvalue.expirable', '@theme_handler']
+    lazy: true
   update.processor:
     class: Drupal\update\UpdateProcessor
     arguments: ['@config.factory', '@queue', '@update.fetcher', '@state', '@private_key', '@keyvalue', '@keyvalue.expirable']
+    lazy: true
   update.fetcher:
     class: Drupal\update\UpdateFetcher
     arguments: ['@config.factory', '@http_client']
+    lazy: true
diff --git a/core/tests/Drupal/Tests/Component/ProxyBuilder/ProxyBuilderTest.php b/core/tests/Drupal/Tests/Component/ProxyBuilder/ProxyBuilderTest.php
index a0f57fe..cab3fb1 100644
--- a/core/tests/Drupal/Tests/Component/ProxyBuilder/ProxyBuilderTest.php
+++ b/core/tests/Drupal/Tests/Component/ProxyBuilder/ProxyBuilderTest.php
@@ -234,6 +234,7 @@ public static function testMethod($parameter)
   protected function buildExpectedClass($class, $expected_methods_body, $interface_string = '') {
     $proxy_class = $this->proxyBuilder->buildProxyClassName($class);
     $expected_string = <<<'EOS'
+function drupal_load_proxy__{{ proxy_class }}() {
 /**
  * Provides a proxy class for \{{ class }}.
  *
@@ -277,6 +278,7 @@ protected function lazyLoadItself()
 {{ expected_methods_body }}
 }
 
+}
 EOS;
     $expected_string = str_replace('{{ proxy_class }}', $proxy_class, $expected_string);
     $expected_string = str_replace('{{ class }}', $class, $expected_string);
diff --git a/core/tests/Drupal/Tests/Component/ProxyBuilder/ProxyDumperTest.php b/core/tests/Drupal/Tests/Component/ProxyBuilder/ProxyDumperTest.php
index 8285306..dfb7f26 100644
--- a/core/tests/Drupal/Tests/Component/ProxyBuilder/ProxyDumperTest.php
+++ b/core/tests/Drupal/Tests/Component/ProxyBuilder/ProxyDumperTest.php
@@ -77,6 +77,7 @@ public function testGetProxyFactoryCode() {
 
     $expected = <<<'EOS'
         if ($lazyLoad) {
+            drupal_load_proxy__Drupal_Tests_Component_ProxyBuilder_TestService_Proxy();
             return $this->services['test_service'] = new Drupal_Tests_Component_ProxyBuilder_TestService_Proxy($this, 'test_service');
         }
 
diff --git a/core/tests/Drupal/Tests/Core/ProxyBuilder/ProxyBuilderTest.php b/core/tests/Drupal/Tests/Core/ProxyBuilder/ProxyBuilderTest.php
index f04b75a..25e329e 100644
--- a/core/tests/Drupal/Tests/Core/ProxyBuilder/ProxyBuilderTest.php
+++ b/core/tests/Drupal/Tests/Core/ProxyBuilder/ProxyBuilderTest.php
@@ -67,6 +67,7 @@ public function complexMethod($parameter, callable $function, \Drupal\Tests\Core
   protected function buildExpectedClass($class, $expected_methods_body, $interface_string = '') {
     $proxy_class = $this->proxyBuilder->buildProxyClassName($class);
     $expected_string = <<<'EOS'
+function drupal_load_proxy__{{ proxy_class }}() {
 /**
  * Provides a proxy class for \{{ class }}.
  *
@@ -112,6 +113,7 @@ protected function lazyLoadItself()
 {{ expected_methods_body }}
 }
 
+}
 EOS;
     $expected_string = str_replace('{{ proxy_class }}', $proxy_class, $expected_string);
     $expected_string = str_replace('{{ class }}', $class, $expected_string);
