make sure your controller extends Symfony\Bundle\FrameworkBundle\Controller\Controller;
you should also check app/console debug:router
in terminal to see what name symfony has named the route
in my case it used a minus instead of an underscore
i.e blog-show
$uri = $this->generateUrl('blog-show', ['slug' => 'my-blog-post']);