EF codefirst使用 Enable-Migrations报错

PM> Enable-Migrations
Join-Path : 无法将参数绑定到参数“Path”,因为该参数是空值。
所在位置 F:\MyBlogNew\MyBlogNewApi\packages\EntityFramework.6.2.0\tools\EntityFramework.psm1:715 字符: 27
+     $toolsPath = Join-Path <<<<  $installPath tools
    + CategoryInfo          : InvalidData: (:) [Join-Path], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand
 
Join-Path : 无法将参数绑定到参数“Path”,因为该参数是空值。
所在位置 F:\MyBlogNew\MyBlogNewApi\packages\EntityFramework.6.2.0\tools\EntityFramework.psm1:782 字符: 73
+     $utilityAssembly = [System.Reflection.Assembly]::LoadFrom((Join-Path <<<<  $ToolsPath EntityFramework.PowerShell.Utility.dll))
    + CategoryInfo          : InvalidData: (:) [Join-Path], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand
 
不能对值为空的表达式调用方法。
所在位置 F:\MyBlogNew\MyBlogNewApi\packages\EntityFramework.6.2.0\tools\EntityFramework.psm1:783 字符: 50
+     $dispatcher = $utilityAssembly.CreateInstance <<<< (
    + CategoryInfo          : InvalidOperation: (CreateInstance:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
 
Join-Path : 无法将参数绑定到参数“Path”,因为该参数是空值。
所在位置 F:\MyBlogNew\MyBlogNewApi\packages\EntityFramework.6.2.0\tools\EntityFramework.psm1:812 字符: 19
+         (Join-Path <<<<  $runner.ToolsPath EntityFramework.PowerShell.dll),
    + CategoryInfo          : InvalidData: (:) [Join-Path], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand
 
PM> Install-Package EntityFramework 6.0.0
Install-Package : 在活动的解决方案中未找到兼容的项目。
所在位置 行:1 字符: 16
+ Install-Package <<<<  EntityFramework 6.0.0
    + CategoryInfo          : InvalidOperation: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetNoCompatibleProjects,NuGet.PowerShell.Commands.InstallPackageCommand
 

解决方案:
将原有的EF框架删除,替换,再引入最新的(不知道需不需要最新的),获取重新引入一次就好了,然后再执行就好了。


2789632-3b18269684ea9294.png
公众号.png
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值