VS 2015 (RC)下Entitiy Framework 升级后CodeFirst命令不能使用
前阵子闲的没事吧自己项目的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命令不能使用的更多相关文章
- macOS 升级后重装命令行工具的问题
问题背景 最近升级个人macbook 从 10.13 到 10.14 在终端输入 git 不能用了,发现是重装操作系统后原来的 Command Line Tools 被自动卸载了, 采用 xcode- ...
- OS X 10.9 Mavericks下如何安装Command Line Tools(命令行工具)
OS X 10.9 Mavericks下如何安装Command Line Tools(命令行工具) 今天OS X 10.9 Mavericks正式发布,免费更新,立即去更新看看效果. 不过升级后安装命 ...
- CentOS6 系统下升级python后yum命令使用时报错
CentOS6 系统下升级python后yum命令使用时报错,如下: [root@xxxxxxx]#yumFile"/usr/bin/yum",line30exceptKeyboa ...
- CENTOS下Python 升级后YUM无法使用的解决办法
Python有很多实用的工具,安装依赖python版本较高,升级Python后导致yum无法使用. 原因: 系统自带的yum依赖Python老版本,升级后不兼容 解决办法: 1. 列出所有版本,确定老 ...
- Visual Studio 2015 RC版官方下载(ISO)
微软Build2015开发者大会发布了下代开发套件Visual Studio 2015 RC候选版,覆盖企业版.专业版以及免费授权的Community社区版,原生支持开发通用型Windows Apps ...
- 关于kali2.0rolling中metasploit升级后无法启动问题的解决总结
最近在学习metasploit的使用,文中提到可以使用msfupdate命令来对metasploit的payload.exploit等进行升级,我就试了一下,没想到升级过程并不麻烦,但升级后却出现了无 ...
- 【Win10 应用开发】解决VS 2015 RC不能调试手机应用的问题
VS2015 RC已发布,当然这个版本还不能用于实际生产中,如果你没有测试环境,就等正式版出来,RC都来了,RTM就不远了. 如果你也像老周一样,已经在耍RC版了,你可能会遇到下面问题: 安装Win ...
- 转:linux下安装或升级GCC4.8,以支持C++11标准
转:http://www.cnblogs.com/lizhenghn/p/3550996.html C++11标准在2011年8月份获得一致通过,这是自1998年后C++语言第一次大修订,对C++语言 ...
- linux下安装或升级GCC4.8,以支持C++11标准
C++11标准在2011年8月份获得一致通过,这是自1998年后C++语言第一次大修订,对C++语言进行了改进和扩充.随后各编译器厂商都各自实现或部分实现了C++中的特性. 如需查看各编译器对C++1 ...
随机推荐
- jQuery.Autocomplete实现自动完成功能
一.http://www.w3c.com.cn/jquery-plugin-autocomplete-参数及实例 二.jQuery plugin: Autocomplete 参数 minChars: ...
- org.springframework.web.filter.DelegatingFilterProxy的理解
org.springframework.web.filter.DelegatingFilterProxy可以将filter交给spring管理. 我们web.xml中配置filter时一般采用下面这种 ...
- [思维题]Bored Qishen
给出一个整数集,其中包含1-n的所有整数,要求挑选出一个元素最多的子集,使得子集中任意两数的乘积不是完全平方数 (n<=10^6) 求这样一个最大子集的元素个数 #include <cst ...
- 教程-Supports判断接口(Instance)是否支持
function TCommandEnabledController.GetCommandVisible(const ACommandName: string): Boolean; var I: In ...
- 简单OS(ucos超级精简版)——裸调度器【worldsing笔记】
简单原则少ROM,少RAM,任务完成就让出CPU,调度器描述: 1.按最大任务数轮番调度: 2.任务调用延时接口将让出CPU使用权,进入下一个任务调度: 3.用户任务都处于延时或是不使用CPU运行Id ...
- [置顶] Objective-C ,ios,iphone开发基础:protocol 协议(委托,代理)的声明
协议是为了弥补Objective-c中类只能单继承的缺陷,在Objective-c2.0之前当一个类遵循一个协议的时候,必须在类中实现协议的所有方法,在Objective-c2.0之后协议中的方法就有 ...
- HBase in 2013
2013年马上就要过去了,总结下这一年HBase在这么一年中发生的主要变化.影响最大的事件就是HBase 0.96的发布,代码结构已经按照模块化release了,而且提供了许多大家迫切需求的特点.这些 ...
- HDU 1330 Nearest Common Ancestors(求两个点的近期公共祖先)
题目链接:id=1330">传送门 在线算法: #include <iostream> #include <cstdio> #include <cstri ...
- android学习日记0--开发需要掌握的技能
一.开发android,我们需要哪些技能基础 1.Java基础知识 2.Linux基础知识 3.数据库基础知识 4.网络协议 5.Android基础知识 6.服务器端开发知识 1.Java基础知识 很 ...
- 使用air进行移动app开发常见功能和问题(二)
1. Air如何判断android.ios 平台网络连接状态? Android,使用as3原生api: if(NetworkInfo.isSupported)//只有android支持 Networ ...