问题
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:
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
来源:https://stackoverflow.com/questions/58357679/add-migration-cannot-bind-argument-to-parameter-path-because-it-is-null