title: Each type name in a schema must be unique. Code first
body: <p>I'm trying to update my database Code first but I get this error after Run add-migration command</p>
  
  <pre><code>One or more validation errors were detected during model generation:
  
  ServicioTest.ErrorDispositivo: Name: Each type name in a schema must be 
  unique. Type name 'ErrorDispositivo' is already defined.
  </code></pre>
  
  <p>I've tried a lot of possible solutions:</p>
  
  <ul>
  <li>Clean and rebuild</li>
  <li>Delete Migrations folder and tables in database</li>
  <li>Change connection string name</li>
  <li>Delete bin folder and then rebuild</li>
  </ul>
  
  <p>But doesn't work.</p>
  
  <p>My data is </p>
  
  <pre><code>public class ModeloDatos : DbContext
  {
  
      public ModeloDatos()
          : base("name=ModeloDatos")
      {
      }
      public virtual DbSet&lt;Dispositivos&gt; Dispositivos { get; set; }
      public virtual DbSet&lt;Solicitud&gt; Solicitudes { get; set; }
      public virtual DbSet&lt;Aplicacion&gt; Aplicaciones { get; set; }
      public virtual DbSet&lt;Log&gt; Logs { get; set; }
      public virtual DbSet&lt;ErrorDispositivo&gt; ErroresDispositivo { get; set; }
      public virtual DbSet&lt;FormatoTemplate&gt; FormatosTemplate { get; set; }
  }
  
  [Table("Dispositivos")]
  public class Dispositivos
  {
      [Key]
      public string DispositivoID { get; set; }
  
      //propiedad de navegacion
      public virtual ICollection&lt;Solicitud&gt; Solicitudes { get; set; }
  }
  
  
  
  [Table("Solicitudes")]
  public class Solicitud
  {
      //primary key
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public int SolicitudID { get; set; }
      public DateTime Fecha { get; set; }
      public string Ip { get; set; }
  
  
      public string DispositivoID { get; set; }
      [ForeignKey("DispositivoID")]
      public virtual Dispositivos Dispositivo { get; set; }
  
  
      public Respuesta DatosRespuesta { get; set; }
  
  
  }
  
  
  [Table("Aplicaciones")]
  public class Aplicacion
  {
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public int Id { get; set; }
  
      public string Usuario { get; set; }
  
      [DataType(DataType.Password)]
      public string Clave { get; set; }
  
      public Guid Codigo { get; set; }
  
      public bool Habilitado { get; set; }
  
  }
  
  [Table("Logs")]
  public class Log
  {
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public int Id { get; set; }
      public string Descripcion { get; set; }
      public string StackTrace { get; set; }
  }
  
  [ComplexType]
  public class Respuesta
  {
  
      public string Codigo { get; set; }
      [ForeignKey("Codigo")]
      public virtual ErrorDispositivo TipoErrorDispositivo { get; set; }
  
  
      public string Mensaje { get; set; }
      public string FingerPrint1 { get; set; }
      public string FingerPrint2 { get; set; }
  
  
  }
  
  [Table("ErrorDispositivos")]
  public class ErrorDispositivo
  {
      [Key]
      public string Codigo { get; set; }
      public string Descripcion { get; set; }
  }
  
  
  [Table("FormatoTemplates")]
  public class FormatoTemplate
  {
      [Key]
      public int Codigo { get; set; }
      public string Formato { get; set; }
  }
  </code></pre>
  
  <p>How can I solve this ?</p>