title: Cannot instantiate implementation type In .net core
body: <p>i am creating an application in .Net Core. I am getting following exception in Program.cs file as follows</p>
  
  <p>"System.ArgumentException: 'Cannot instantiate implementation type 'BotHub.DataAccessLayer.BackgroundDataAccess' for service type 'Microsoft.Extensions.Hosting.IHostedService'.'"</p>
  
  <p>My Program.cs file as Follows:</p>
  
  <pre><code> public static void Main(string[] args)
          {
              CreateWebHostBuilder(args).Build().Run();
          }
  
          public static IWebHostBuilder CreateWebHostBuilder(string[] args) =&gt;
              WebHost.CreateDefaultBuilder(args)
                  .UseStartup&lt;Startup&gt;().ConfigureServices((hostcontext, service) =&gt;
                  {
                      service.AddHostedService&lt;BackgroundDataAccess&gt;();
                  });
  
      }
  </code></pre>