前阵子闲的没事吧自己项目的Entitiy Framework 升级到6.1.3了,然后紧接着问题来了:

Join-Path : 无法将参数绑定到参数“Path”,因为该参数是空值。
所在位置 F:\Source\WebSolution\packages\EntityFramework.6.1.\tools\EntityFramework.psm1: 字符:
+ $toolsPath = Join-Path <<<< $installPath tools
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand Join-Path : 无法将参数绑定到参数“Path”,因为该参数是空值。
所在位置 F:\Source\WebSolution\packages\EntityFramework.6.1.\tools\EntityFramework.psm1: 字符:
+ $utilityAssembly = [System.Reflection.Assembly]::LoadFrom((Join-Path <<<< $ToolsPath EntityFramework.PowerShell.Utility.dll))
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand 不能对值为空的表达式调用方法。
所在位置 F:\Source\WebSolution\packages\EntityFramework.6.1.\tools\EntityFramework.psm1: 字符:
+ $dispatcher = $utilityAssembly.CreateInstance <<<< (
+ CategoryInfo : InvalidOperation: (CreateInstance:String) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull Join-Path : 无法将参数绑定到参数“Path”,因为该参数是空值。
所在位置 F:\Source\WebSolution\packages\EntityFramework.6.1.\tools\EntityFramework.psm1: 字符:
+ (Join-Path <<<< $runner.ToolsPath EntityFramework.PowerShell.dll),
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand Join-Path : 无法将参数绑定到参数“Path”,因为该参数是空值。
所在位置 F:\Source\WebSolution\packages\EntityFramework.6.1.\tools\EntityFramework.psm1: 字符:
+ $toolsPath = Join-Path <<<< $installPath tools
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand Join-Path : 无法将参数绑定到参数“Path”,因为该参数是空值。
所在位置 F:\Source\WebSolution\packages\EntityFramework.6.1.\tools\EntityFramework.psm1: 字符:
+ $utilityAssembly = [System.Reflection.Assembly]::LoadFrom((Join-Path <<<< $ToolsPath EntityFramework.PowerShell.Utility.dll))
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand 不能对值为空的表达式调用方法。
所在位置 F:\Source\WebSolution\packages\EntityFramework.6.1.\tools\EntityFramework.psm1: 字符:
+ $dispatcher = $utilityAssembly.CreateInstance <<<< (
+ CategoryInfo : InvalidOperation: (CreateInstance:String) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull Join-Path : 无法将参数绑定到参数“Path”,因为该参数是空值。
所在位置 F:\Source\WebSolution\packages\EntityFramework.6.1.\tools\EntityFramework.psm1: 字符:
+ (Join-Path <<<< $runner.ToolsPath EntityFramework.PowerShell.dll),
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

一大堆的乱起八糟的,开始以为是Entitiy Framework版本问题或者是VS的问题,各种乱试都没能成功。

无奈只得翻墙GOOGLE了最后得到的结论是:跟Entitiy Framework的版本以及VS都无关是PowerShell的版本问题,

查了下我机器上是2.0版本的

PS C:\Users\PC> $PSVersionTable.PSVersion

Major Minor Build Revision
----- ----- ----- --------
2 0 -1 -1

于是想法升级(我的版本选择错误,这是个4。0的版本建议升级3.0试试能够成功解决)

Windows Management Framework 4.0

下载地址

https://www.microsoft.com/zh-CN/download/details.aspx?id=40855

我系统是win7 于是下载了 Windows6.1-KB2819745-x64-MultiPkg.msu

悲剧的事这个PowerShell居然是4.0版本的升级过头了出现了新问题:

New-Object : 提供的值无效或属性是只读的。请更改该值,然后再试一次。所在位置 F:\Source\WebSolution\packages\EntityFramework.6.1.\tools\EntityFramework.psm1: 字符:
+ $info = New-Object System.AppDomainSetup -Property @{
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [New-Object],Exception
+ FullyQualifiedErrorId : SetValueException,Microsoft.PowerShell.Commands.NewObjectCommand 在此对象上找不到属性“PrivateBinPath”。请确认该属性存在并且可设置。所在位置 F:\Source\WebSolution\packages\EntityFramework.6.1.\tools\EntityFramework.psm1: 字符:
+ $info.PrivateBinPath += ';lib\net45'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [],RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound 使用“”个参数调用“LoadFrom”时发生异常:“指定的路径或文件名太长,或者两者都太长。完全限定文件名必须少于 个字符,并且目录名必须少于 个字符。”所在位置 F:\Source\WebSolution\packages\EntityFramework.6.1.\tools\Entit
yFramework.psm1: 字符:
+ $utilityAssembly = [System.Reflection.Assembly]::LoadFrom((Join-Path $ToolsP ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : PathTooLongException 不能对 Null 值表达式调用方法。所在位置 F:\Source\WebSolution\packages\EntityFramework.6.1.\tools\EntityFramework.psm1: 字符:
+ $dispatcher = $utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [],RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull 使用“”个参数调用“CreateInstanceFrom”时发生异常:“指定的路径或文件名太长,或者两者都太长。完全限定文件名必须少于 个字符,并且目录名必须少于 个字符。”所在位置 F:\Source\WebSolution\packages\EntityFramework.6.1.\t
ools\EntityFramework.psm1: 字符:
+ $domain.CreateInstanceFrom(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : PathTooLongException

无奈继续求助GOOGLE吧

得到的结论很多有替换EntityFramework.psm1文件,有升级Nuget。

https://github.com/aspnet/EntityFramework/issues/1950#issuecomment-99164398

只得替换EntityFramework.psm1好些没啥效果

最终选择了升级NuGet 3.0 RC2

成功解决!

走了很多弯路,也不知道是不是最正确的解决版本,希望能给遇到同样问题的有所帮助吧。

VS 2015 (RC)下Entitiy Framework 升级后CodeFirst命令不能使用的更多相关文章

  1. macOS 升级后重装命令行工具的问题

    问题背景 最近升级个人macbook 从 10.13 到 10.14 在终端输入 git 不能用了,发现是重装操作系统后原来的 Command Line Tools 被自动卸载了, 采用 xcode- ...

  2. OS X 10.9 Mavericks下如何安装Command Line Tools(命令行工具)

    OS X 10.9 Mavericks下如何安装Command Line Tools(命令行工具) 今天OS X 10.9 Mavericks正式发布,免费更新,立即去更新看看效果. 不过升级后安装命 ...

  3. CentOS6 系统下升级python后yum命令使用时报错

    CentOS6 系统下升级python后yum命令使用时报错,如下: [root@xxxxxxx]#yumFile"/usr/bin/yum",line30exceptKeyboa ...

  4. CENTOS下Python 升级后YUM无法使用的解决办法

    Python有很多实用的工具,安装依赖python版本较高,升级Python后导致yum无法使用. 原因: 系统自带的yum依赖Python老版本,升级后不兼容 解决办法: 1. 列出所有版本,确定老 ...

  5. Visual Studio 2015 RC版官方下载(ISO)

    微软Build2015开发者大会发布了下代开发套件Visual Studio 2015 RC候选版,覆盖企业版.专业版以及免费授权的Community社区版,原生支持开发通用型Windows Apps ...

  6. 关于kali2.0rolling中metasploit升级后无法启动问题的解决总结

    最近在学习metasploit的使用,文中提到可以使用msfupdate命令来对metasploit的payload.exploit等进行升级,我就试了一下,没想到升级过程并不麻烦,但升级后却出现了无 ...

  7. 【Win10 应用开发】解决VS 2015 RC不能调试手机应用的问题

    VS2015 RC已发布,当然这个版本还不能用于实际生产中,如果你没有测试环境,就等正式版出来,RC都来了,RTM就不远了. 如果你也像老周一样,已经在耍RC版了,你可能会遇到下面问题: 安装Win ...

  8. 转:linux下安装或升级GCC4.8,以支持C++11标准

    转:http://www.cnblogs.com/lizhenghn/p/3550996.html C++11标准在2011年8月份获得一致通过,这是自1998年后C++语言第一次大修订,对C++语言 ...

  9. linux下安装或升级GCC4.8,以支持C++11标准

    C++11标准在2011年8月份获得一致通过,这是自1998年后C++语言第一次大修订,对C++语言进行了改进和扩充.随后各编译器厂商都各自实现或部分实现了C++中的特性. 如需查看各编译器对C++1 ...

随机推荐

  1. POJ3468--A Simple Problem with Integers(Splay Tree)

    虽然有点难,但是这套题都挂了一个月了啊喂…… 网上模板好多……最后还是抄了kuangbin聚聚的,毕竟好多模板都是抄他的,比较习惯…… POJ 3468 题意:给n个数,两种操作,区间整体加一个数,或 ...

  2. python 继承和多态

    在OOP程序设计中,当我们定义一个class的时候,可以从某个现有的class继承,新的class称为子类(Subclass),而被继承的class称为基类.父类或超类(Base class.Supe ...

  3. 配dump文件

    ulimit -c unlimited echo 'ulimit -c unlimited' >>/etc/profile

  4. matlab color_rain colorbar

    来自http://www.aos.wisc.edu/~dvimont/matlab/Graphics_Tools/color_rain.html Listing of script color_rai ...

  5. hadoop 1.2 集群搭建与环境配置

    一.虚拟机环境 见我的另一篇博客http://www.cnblogs.com/xckk/p/6000881.html, 需要安装JDK环境,centos下安装JDK可参考: http://www.ce ...

  6. 基础数据结构 之 树(python实现)

    树是数据结构中常用到的一种结构,其实现较栈和队稍为复杂一些.若树中的所有节点的孩子节点数量不超过2个,则该为一个二叉树.二叉树可用于查找和排序等.二叉树的主要操作有:建树,遍历等.遍历是树中的一个最为 ...

  7. hdu 5442 Favorite Donut 后缀数组

    Favorite Donut Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid ...

  8. Java正則表達式入门

     众所周知,在程序开发中,难免会遇到须要匹配.查找.替换.推断字符串的情况发生,而这些情况有时又比較复杂,假设用纯编码方式解决,往往会浪费程序猿的时间及精力.因此,学习及使用正則表達式,便成了解决这一 ...

  9. android Popupwindow 的一个demo源码

    一直想用一下PopupWindow,就是苦于没有demo,自己去研究有太懒,刚好最近研究推送,下载了一个腾讯信鸽的demo,里面用到了一个PopupWindow,效果还不错,弄下来记录一下: 1.核心 ...

  10. linux cpio 备份命令

     cpio 命令  [root@linux ~]# cpio -covB > [file|device] <==备份[root@linux ~]# cpio -icduv < [fi ...