0
votes

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!!

1
Are you sure you are trying to add migration to your EF model? - Adlorem
Did you run Enable-Migrations first? - Lasse Holm
@LasseHolm yes i did - Soltan Al-khatib
@SoltanAl-khatib have a look at this solution. It might be the solution you are looking for. - Lasse Holm

1 Answers

3
votes

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