title: there was an error running the selected code generator in .net6
body: <p>I use .net 6 and when I use Add an ASP.NET Core MVC controller with views, using Entity Framework Core(I do this in Area). I get an error.</p>
  <p>I searched a lot but did not find any</p>
  <p>error:</p>
  <p><a href="https://i.stack.imgur.com/usJxA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/usJxA.png" alt="enter image description here" /></a></p>
  <p>DBContext:</p>
  <pre><code>
  namespace PotLearn.DataLayer.Context
  {
      public class PotLearnContext:DbContext
      {
          public PotLearnContext(DbContextOptions&lt;PotLearnContext&gt; options)
      : base(options)
          {
          }
          #region User
          public DbSet&lt;User&gt; Users { get; set; }
          #endregion
  
      }
  }
  </code></pre>
  <p>program.cs:</p>
  <pre><code>
  var builder = WebApplication.CreateBuilder(args);
  
  // Add services to the container.
  builder.Services.AddControllersWithViews();
  #region DataBase Context
      var connectionString = builder.Configuration.GetConnectionString(&quot;PotLearnConnection&quot;);
      builder.Services.AddDbContext&lt;PotLearnContext&gt;(options =&gt; options.UseSqlServer(connectionString));
  #endregion
  var app = builder.Build();
  
  // Configure the HTTP request pipeline.
  if (!app.Environment.IsDevelopment())
  {
      app.UseExceptionHandler(&quot;/Home/Error&quot;);
      // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
      app.UseHsts();
  }
  
  
  
  
  app.UseHttpsRedirection();
  app.UseStaticFiles();
  
  app.UseRouting();
  
  app.UseAuthorization();
  
  app.MapControllerRoute(
      name: &quot;default&quot;,
      pattern: &quot;{controller=Home}/{action=Index}/{id?}&quot;);
  app.UseEndpoints(endpoints =&gt;
  {
      endpoints.MapControllerRoute(
        name: &quot;areas&quot;,
        pattern: &quot;{area:exists}/{controller=Home}/{action=Index}/{id?}&quot;
      );
  });
  
  app.Run();
  
  </code></pre>
  <p>How can I fix this error?</p>
  <p>Thankyou.</p>