0

I want to enable migration in visual studio 2017. When I run it, I'm getting an error. The error message is:

add-migration : Cannot bind argument to parameter 'Path' because it is null. At line:1 char:1 + add-migration ApplyAnnotationsToCustomerName + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Add-Migration], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Add-Migration.

I tried to uninstalling and reinstall EntityFramework and it didn't work.

Also my startup project is set to the project with EF. nothing worked!!

4
  • Are you sure you are trying to add migration to your EF model? Commented Oct 12, 2019 at 21:10
  • Did you run Enable-Migrations first? Commented Oct 13, 2019 at 11:29
  • @LasseHolm yes i did Commented Oct 14, 2019 at 13:25
  • @SoltanAl-khatib have a look at this solution. It might be the solution you are looking for. Commented Oct 14, 2019 at 14:30

1 Answer 1

3

Ohh... spent hours trying to figure this one out. I tried all the suggestions I could find and even tried what you did uninstalling and reinstalling EF. Nothing seemed to work and it was really frustrating. In the end what ultimately worked for me was how I uninstalled and reinstalled EF!

Uninstall:

PM> Uninstall-Package EntityFramework -Force

Reinstall EntityFramework:

PM> Install-Package EntityFramework -Pre

Source: https://entityframework.net/knowledge-base/14410987/entity-framework-code-first-migration-error

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.