title: How to create a migration without "No migrations configuration type was found in the assembly" problem?
body: <p>I am trying to create a migration in an ASP.NET Core Web Application, but when I try to do it, the package manager console returns a warning and an error:</p>
  
  <p>Warning: "A version of Entity Framework older than 6.3 is also installed. The newer tools are running. Use 'EntityFramework\Add-Migration' for the older version."</p>
  
  <p>Error: "No migrations configuration type was found in the assembly 'MyProjectName'. (In Visual Studio you can use the Enable-Migrations command from Package Manager Console to add a migrations configuration)."</p>
  
  <p>After doing some research I have found that a common problem is that the default project chosen in the package manager is not correct; but this is not my case, since it only gives me one option, and it is the project with which I am working.
  I have also found that a current solution is to enable the migrations with the "Enable-Migrations" command, but when I try to do this, it gives me the same warning and another error:</p>
  
  <p>error: No context type was found in the assembly 'MyProjectName'.</p>
  
  <p>I have also tried it the "enable-migraitons" command in a different way, "enable-migrations -contexttypename MyDBContextName", but this gives me another error:</p>
  
  <p>error: The context type 'MyDBContextName' was not found in the assembly 'MyProjectName'.</p>
  
  <p>But I actually have the following class:</p>
  
  <pre><code>    public class MyDBContextName: IdentityDbContext&lt;UserModel&gt;
      {
          public MyDBContextName(DbContextOptions&lt;MyDBContextName&gt; options) : base(options)
          { 
          }
      }
  </code></pre>
  
  <p>And I have this in my startup/configure services class:</p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
      services.AddDbContext&lt;MyDBContextName&gt;(options =&gt; options.UseSqlServer("DefaultConnection"));
  
      services.AddIdentity&lt;UserModel, IdentityRole&gt;().AddEntityFrameworkStores&lt;MyDBContextName&gt;().AddDefaultTokenProviders();
  
      services.AddControllers();
  }
  </code></pre>
  
  <p>Lastly, <a href="https://i.stack.imgur.com/rot10.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rot10.png" alt="this"></a> is a picture of my NuGet packages:</p>
  
  <p>Any Idea of what may be causing these errors?
  Thank you so much for your time, if you need more information I will provide it to you ass soon as I see your request. Have a good day. (:</p>