title: Symfony 4 annotation routing does not work
body: <p>I just started learning Symfony. I am following <a href="https://symfony.com/doc/current/page_creation.html" rel="nofollow noreferrer">this official tutorial</a> exactly. Routing works fine when done with <code>config/routes.yaml</code>, but on using <a href="https://symfony.com/doc/current/page_creation.html#annotation-routes" rel="nofollow noreferrer">annotations</a>:</p>
  <pre><code>namespace App\Controller;
  
  use Symfony\Component\HttpFoundation\Response;
  use Symfony\Component\Annotation\Route;
  
  class LuckyController
  {
  
      /**
       *  @Route(&quot;/lucky/number&quot;)
       */
      public function number(){
  
          $number = mt_rand(0, 100);
  
          return new Response(
              '&lt;html&gt;&lt;body&gt;&lt;h1&gt;MyLucky Number: ' . $number . '&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;'
          );
      }
  }
  </code></pre>
  <p>I get this error:</p>
  <pre class="lang-none prettyprint-override"><code>    Exception thrown when handling an exception
  (Symfony\Component\Config\Exception\FileLoaderLoadException: [Semantical Error]
   The annotation &quot;@Symfony\Component\Annotation\Route&quot; in method
  App\Controller\LuckyController::number() does not exist, or could not be auto-loaded
   in C:\wamp\vhosts\mysymfony4\config/routes\../../src/Controller/ (which is
   being imported from &quot;C:\wamp\vhosts\mysymfony4\config/routes/annotations.yaml&quot;). Make sure
   annotations are installed and enabled.)
  </code></pre>