ASP.NET MVC route not resolving controller/action
<p>I have a controller named <code>DocumentsController</code> inside an area called <code>Public</code>.</p>

<pre><code>public class DocumentsController : AsyncController
{
    public async Task&lt;ActionResult&gt; DownloadAsync(string fileName)
    {
        // ...
    }
}
</code></pre>

<p>In the <code>PublicAreaRegistration.cs</code> file I have the following routing setup:</p>

<pre><code>public override void RegisterArea(AreaRegistrationContext context)
{
    context.MapRoute(null, "Public/Documents/Download/{fileName}",
        new { action = "Download", controller = "Documents", area = "Public" });

    context.MapRoute(
        "Public_default",
        "Public/{controller}/{action}/{id}",
        new { action = "Index", id = UrlParameter.Optional, area = "Public" });
}
</code></pre>

<p>And in a view I'm invoking <code>Url.Action()</code> like this:</p>

<pre><code>&lt;a href="@Url.Action("Download", "Documents", new { area = "Public", fileName = document.FileName })"&gt;@document.FileName&lt;/a&gt;
</code></pre>

<p>However, although the url is resolved properly (<a href="http://localhost/test/Public/Documents/Download/my-file.pdf" rel="nofollow">http://localhost/test/Public/Documents/Download/my-file.pdf</a>) the action never gets invoked.</p>

<p>But if I completely remove the first <code>MapRoute</code> call the url is resolved to <a href="http://localhost/test/Public/Documents/Download?fileName=my-file.pdf" rel="nofollow">http://localhost/test/Public/Documents/Download?fileName=my-file.pdf</a> and the action method gets invoked as expected.</p>

<p>What am I doing wrong?</p>