title: Unable to resolve service for type
body: <p>I have an interface to a send mail async function which I am using for my email functions in my controller class.</p>
  
  <pre><code>private readonly UserManager&lt;ApplicationUser&gt; _userManager;
  private readonly SignInManager&lt;ApplicationUser&gt; _signInManager;
  private readonly IEmailSender _emailSender;
  
  public AccountController(UserManager&lt;ApplicationUser&gt; userManager,
                           SignInManager&lt;ApplicationUser&gt; signInManager,
                           IEmailSender emailSender)
  {
          _userManager = userManager;
          _signInManager = signInManager;
          _emailSender = emailSender;
  }
  </code></pre>
  
  <p>As you see I am using the <code>IEmailSender emailSender</code> to create the object and setting it to its instance in the routine <code>AccountController</code>.</p>
  
  <p>The interface is simply made up of one constructor</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Threading.Tasks;
  
  namespace solitude.admin.core.Interfaces
  {
      public interface IEmailSender
      {
          Task SendEmailAsync(string email, string subject, string message);
      }
  }
  </code></pre>
  
  <p>But the problem is when I come to view my view I get the following error:</p>
  
  <blockquote>
    <p>InvalidOperationException: Unable to resolve service for type 'solitude.admin.core.Interfaces.IEmailSender' while attempting to activate 'solitude.admin.core.Controllers.AccountController'.<br>
    Microsoft.Extensions.Internal.ActivatorUtilities.GetService(IServiceProvider sp, Type type, Type requiredBy, bool isDefaultParameterRequired)</p>
  </blockquote>