title: Controller Route not found in production environment
body: <p><strong>The problem</strong>: I am currently working on a custom plugin for Shopware 6 with the development template (<a href="https://github.com/shopware/development" rel="nofollow noreferrer">https://github.com/shopware/development</a>) and testing it on localhost.</p>
  <p>The goal is to use my plugin for our online shop which runs on the production environment (<a href="https://github.com/shopware/production" rel="nofollow noreferrer">https://github.com/shopware/production</a>)</p>
  <p>My problem is that my plugin works exactly like I want on localhost, but not anymore if I upload it to our production environment.</p>
  <p>Example: I wrote a new API Controller that introduces a new Route, which does basically the same as the SyncController does but with a little extra logic.</p>
  <pre><code> * @Route(&quot;/api/v{version}/_action/my-extension/sync&quot;,
   *     name=&quot;api.action.my-extension.sync&quot;,
   *     methods={&quot;POST&quot;}
   * )
  </code></pre>
  <p>The entry in my services.xml:</p>
  <pre><code>     &lt;service id=&quot;MyExtension\Api\Controller\CustomSyncController&quot; public=&quot;true&quot;&gt;
          &lt;argument type=&quot;service&quot; id=&quot;Shopware\Core\Framework\Api\Sync\SyncService&quot;/&gt;
          &lt;argument type=&quot;service&quot; id=&quot;serializer&quot;/&gt;
          &lt;call method=&quot;setContainer&quot;&gt;
              &lt;argument type=&quot;service&quot; id=&quot;service_container&quot;/&gt;
          &lt;/call&gt;
      &lt;/service&gt;
  </code></pre>
  <p>The entry in my routes.xml:</p>
  <pre><code>&lt;import resource=&quot;../../Api/Controller&quot; type=&quot;annotation&quot; /&gt;
  </code></pre>
  <p>As I understand it, that should be sufficient to let Shopware 6 know what my Route is and I should be able to send my POST Request to this Route.</p>
  <p><strong>Everything works fine on localhost.</strong></p>
  <p><strong>My question:</strong>
  What steps do I have to take to use this plugin on our production environment, because I always get this message on production:</p>
  <pre><code>{&quot;errors&quot;:[{&quot;code&quot;:&quot;0&quot;,&quot;status&quot;:&quot;404&quot;,&quot;title&quot;:&quot;Not Found&quot;,&quot;detail&quot;:&quot;No route found for \u0022POST \/api\/v3\/_action\/my-extension\/sync\u0022&quot;}]}
  </code></pre>
  <p>What I tried to make it work:</p>
  <ol>
  <li>just ZIP the folder custom/plugins/MyExtension and upload my plugin to production.</li>
  <li>upload my plugin to localhost, run ./psh.phar administration:build, download the folder from localhost, ZIP this folder and upload it to production.</li>
  <li>upload my plugin to localhost, run ./psh.phar administration:build and ./psh.phar storefront:build, download the folder from localhost, ZIP this folder and upload it to production.</li>
  <li>After uploading my plugin also start the script &quot;build-administration.sh&quot; and &quot;build-storefront.sh&quot; on our production environment.</li>
  </ol>
  <p>Currently I am lost, because I can´t understand what steps are necessary to get the same results in the production environment that I get on localhost.</p>