Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>...and just to add one more possible answer for all those facing similar problem<br> (note: this is an open-ended story seems, as there're obviously some bugs still with the migration part)... This link came closest to what I needed<br> <a href="https://stackoverflow.com/questions/9279671/error-when-running-update-database-with-ef-4-3">Error when running Update-Database with EF 4.3</a> so, you need to do 3 things (in that order - and I'm referring to an existing project):<br> (all is in PM console) </p> <ul> <li>Make sure that 'default project' in PM Console is set to your desired project (i.e. for larger solutions) - that doesn't necessarily match your startup project! (and closely watch the comments/response in PM as to whether the actions were made on the project you want)</li> <li>(1) <code>Enable-Migrations -force</code></li> <li>(2) <code>Add-Migration Initial</code></li> <li>(3) <code>Update-Database -Verbose</code></li> </ul> <p>...if you still get an exception in PM console</p> <ul> <li>(4) <strong>then you might need to 'move' your project into the root</strong> </li> </ul> <p>it sounds silly I know, but that was the main problem on my side - I had a bunch of solution folders and any of the above would fail on projects within solution folders. However, once I moved the project to the root, everything worked fine (no more exceptions, with or w/o first-chance exceptions for CLR turned on or off)...<br> hope this helps somebody </p> <p><strong>EDIT:</strong> if your data model project (EF CF) is a library - then set that project as a 'default project' in PM console - and run all those things above on that project directly (and have migration configuration etc. created in the lib itself). Otherwise it'd fail (and the same no MigrationHistory exception also appears when your model is a lib - and no migration defined for it, within it - and you have migration defined on the 'main project'). </p> <p><strong>EDIT:</strong> you'd need to move both the lib (EF model) and the 'startup' project (calling it) into the root.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload