Unable to generate an explicit migration in entity framework

后端 未结 28 1522
情书的邮戳
情书的邮戳 2020-12-12 23:31

I am adding a new migration but this message shows:

Unable to generate an explicit migration because the following explicit migrations are pending:

28条回答
  •  情书的邮戳
    2020-12-12 23:56

    When running into this issue, please try adding parameters to your add-migration cmdlet. For example, specifying the start up project as well as the connection string name could help EF find your target database.

    add-migration Delta_Defect_0973 -ConfigurationTypeName your.namespace.ContextClassName -StartUpProject DeltaProject -ConnectionStringName DeltaSQL
    

    Where:

    Delta_Defect_0973 is the name of your migration

    your.namespace.ContextClassName is the name of your Configuration class in your migration folder, prefixed with the full name space.

    DeltaProject is the name of your main project with your web.config or app.config file.

    DeltaSQL is the name of your connection string defined in your web.config or app.config file.

提交回复
热议问题