title: Controller has no container set, did you forget to define it as a service subscriber
body: <p>I'm trying to refactor some controllers in Symfony 5 server, but suddenly I'm unable to change or create controllers because of the following error:</p>
  
  <p><em>'App\Controller{{ControllerName}}' has no container set, did you forget to define it as a service subscriber?</em></p>
  
  <p>This is the controller:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Controller;
  
  use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  use Symfony\Component\Routing\Annotation\Route;
  use Symfony\Component\HttpFoundation\Request;
  use App\Entity\Shiftsummary;
  use App\Entity\Station;
  use App\Entity\Shift;
  use App\Entity\Line;
  use \Datetime;
  
  class StartStationController extends AbstractController {
      /**
       * @Route("/start", name="StartStation")
       */
  
      public function route(Request $request)
      {
        ...
      }  }
  </code></pre>
  
  <p>This is the content of <em>service.yaml</em></p>
  
  <pre><code>services:
      _defaults:
          autowire: true  
          autoconfigure: true 
  
      App\:
          resource: '../src/*'
          exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'
  
      App\Controller\:
          resource: '../src/Controller'
          tags: ['controller.service_arguments']
  </code></pre>
  
  <p>The controllers are inside the <em>src/controller/</em> folder</p>
  
  <p><a href="https://i.stack.imgur.com/Vhfwp.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Vhfwp.png" alt="enter image description here"></a></p>