add-migration:无法将参数绑定到参数"Path",因为它为null [英] add-migration : Cannot bind argument to parameter 'Path' because it is null

查看:323
本文介绍了add-migration:无法将参数绑定到参数"Path",因为它为null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Visual Studio 2017中启用迁移.运行它时,出现错误.错误消息是:

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

add-migration:无法将参数绑定到参数"Path",因为它是 空值.在第1行:char:1 +添加迁移ApplyAnnotationsToCustomerName + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo:InvalidData:(:) [Add-Migration],ParameterBindingValidationException + FullyQualifiedErrorId:ParameterArgumentValidationErrorNullNotAllowed,添加迁移.

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.

我尝试卸载并重新安装EntityFramework,但是它不起作用.

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

我的启动项目也被设置为带有EF的项目. 没有任何作用!

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

推荐答案

哦...花了数小时试图弄清楚这一点.我尝试了所有可以找到的建议,甚至尝试了卸载和重新安装EF的操作.似乎没有任何工作,这确实令人沮丧.最后,最终对我有用的是如何卸载并重新安装EF!

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!

卸载:

PM> Uninstall-Package EntityFramework -Force

重新安装EntityFramework:

Reinstall EntityFramework:

PM> Install-Package EntityFramework -Pre

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

这篇关于add-migration:无法将参数绑定到参数"Path",因为它为null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆