locked
EF - Migration fails RRS feed

  • Question

  •  After doing some changes to my classes once I am trying to execute Migration get the message:

    at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
    Sequence contains no matching element

    What could it be ?

    Monday, August 18, 2014 9:08 PM

Answers

  • Hello,

    >>What could it be ?

    Could you please describe what changes you did with your model and share your model with us?

    Since we do not know the exact scenario, what we can is provide some information regarding this error.

    This error would be caused by renaming PK property when self-referencing relationship with no FK property, for details, please refer to this link below, it provides a detail description and the solution:

    http://entityframework.codeplex.com/workitem/569

    When defining type and size of a column with DataAnnotations as below would also cause this error:

    [Column(TypeName="VARCHAR(254)")]
    
    public string ColumnName { get; set; }
    
    We should define it as:
    [MaxLength(254)]
    
    [Column(TypeName="VARCHAR")]
    
    public string ColumnName { get; set; }
    

    Please check if you are under one of them.

    Best Regards,

    Fred.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Fred Bao Wednesday, August 27, 2014 6:58 AM
    Tuesday, August 19, 2014 9:04 AM