title: DbContextOptionsBuilder' does not contain a definition for 'usesqlserver' and no extension method 'usesqlserver' in asp.net core 2.2?
body: <p>project version : .netcore2.2</p>
  
  <p>I m working With N-Tier Architecture in .netcore2.2</p>
  
  <p>when I defining below configuration then give the error:</p>
  
  <p><strong>DbContextOptionsBuilder' does not contain a definition for 'usesqlserver' and no extension method 'usesqlserver'</strong> </p>
  
  <pre><code>
      public class CustomerDataAccess : DbContext, ICustomerDataAccess
      {
  
          protected override void OnConfiguring(DbContextOptionsBuilder dbContextOptionsBuilder)
          {
              if (!dbContextOptionsBuilder.IsConfigured &amp;&amp; _configuration.GetConnectionString("DMEBaseConnection") != null)
              {
                  dbContextOptionsBuilder.UseSqlServer(_configuration.GetConnectionString("connectionstringname")); **//here give an error**
              }
          }
  </code></pre>
  
  <p>startup.cs</p>
  
  <pre><code>    public class Startup
      {
          // This method gets called by the runtime. Use this method to add services to the container.
          // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
          public void ConfigureServices(IServiceCollection services)
          {
          }
  
          // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
          public void Configure(IApplicationBuilder app, IHostingEnvironment env)
          {
              if (env.IsDevelopment())
              {
                  app.UseDeveloperExceptionPage();
              }
  
              app.Run(async (context) =&gt;
              {
                  await context.Response.WriteAsync("Hello World!");
              });
          }
      }
  </code></pre>
  
  <p>program.cs</p>
  
  <pre><code>namespace projectname
  {
      public class Program
      {
          public static void Main(string[] args)
          {
              CreateWebHostBuilder(args).Build().Run();
          }
  
          public static IWebHostBuilder CreateWebHostBuilder(string[] args) =&gt;
              WebHost.CreateDefaultBuilder(args)
                  .UseStartup&lt;Startup&gt;();
      }
  }
  </code></pre>
  
  <p>see below image:</p>
  
  <p><a href="https://i.stack.imgur.com/TznZ6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TznZ6.png" alt="enter image description here"></a></p>
  
  <p>when I install this:</p>
  
  <pre><code>Install-Package Microsoft.EntityFrameworkCore.SqlServer
  Install-Package Microsoft.EntityFrameworkCore.SqlServer -Version 2.2.6
  Install-Package Microsoft.EntityFrameworkCore.SqlServer -Version 3.1.2
  </code></pre>
  
  <p>Current Error:</p>
  
  <pre><code>NU1608: Detected package version outside of dependency constraint: Microsoft.AspNetCore.App 2.2.0 requires Microsoft.EntityFrameworkCore.SqlServer (&gt;= 2.2.0 &amp;&amp; &lt; 2.3.0) but version Microsoft.EntityFrameworkCore.SqlServer 3.1.2 was resolved.
  
  projectname-&gt; projectname.BusinessLogic -&gt; projectname.DataAccess -&gt; Microsoft.EntityFrameworkCore (&gt;= 3.1.2) 
   projectname-&gt; Microsoft.AspNetCore.App 2.2.0 -&gt; Microsoft.EntityFrameworkCore (&gt;= 2.2.0 &amp;&amp; &lt; 2.3.0).
  
  </code></pre>
  
  <p>I m trying to solve this error last midday but error not solved</p>
  
  <p>plz, help?</p>