The AuthorizationPolicy named: 'Admin' was not found
<p>I am learning Authentication/Authorization in .NET Core MVC. </p>

<p>I am trying to create a controller that can only be accessed by 'Admin', but get the following error.</p>

<blockquote>
  <p>An unhandled exception occurred while processing the request.</p>
  
  <p>InvalidOperationException: The AuthorizationPolicy named: 'Admin' was
  not found.</p>
</blockquote>

<p>Here's my code. What should I do?</p>

<pre><code>[HttpGet("~/Test")]
[Authorize("Admin")]
public async Task&lt;string&gt; MyMethod()
{
    return await Task&lt;string&gt;.Run(() =&gt; "Hello Admin");
}
</code></pre>