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 ...
随机推荐
- Linux下安装memcache
1.Memcache用到了libevent(这个库用于Socket的处理),需要安装libevent: (1)tar zxvf libevent.tar.gz 后进入解压后的文件夹 (2)./conf ...
- tomcat memory leak
Struts + Hibernate做项目,重新部署项目会出现Memory Leak严重报错.虽然不影响使用,但还是有风险.经实验发现是Hibernate的session没有关闭.....粗心....
- JDBC注册驱动的三种方式
JDBC注册驱动的三种方式 1.通过导入的JDBC的驱动包拿到的com.mysql.jdbc.Driver对象,利用java.sql.DriverManager对象的DriverManager.reg ...
- Intra Refresh of H264 encoder
https://en.wikipedia.org/wiki/X264 x264 is able to use Periodic Intra Refresh instead of keyframes, ...
- [C++]VAssistX函数添加注释功能设置
问题情况:每次手写注释太慢,而且不系一.问题原因:C++可以利用宏写注释,也可以使用VAssistX提供的方法.问题处理:1.安装VAssistX在VS2010上 2.VS2010菜单->VAs ...
- 利用Microsoft Azure Machine Learning Studio创建机器学习实例
Microsoft Azure云服务推出机器学习的模块,用户只需上传数据,利用机器学习模块提供的一些算法接口和R语言或别的语言接口,就能利用Microsoft Azure强大的云计算能力来实现自己的机 ...
- JavaScript要点(十) HTML DOM - 改变 HTML
HTML DOM 允许 JavaScript 改变 HTML 元素的内容. A.改变 HTML 输出流 JavaScript 能够创建动态的 HTML 内容: 今天的日期是: Thu Oct 13 2 ...
- DRM你又赢了:其API纳入HTML5标准
摘要:W3C今天发布了一份加密媒体扩展工作草案(EME),将支持DRM多媒体数字内容,而且浏览器将无需使用Flash或Silverlight.EME定义了一系列API,允许JavaScript和HTM ...
- hbase运维
NoSQL现在风生水起,hbase的使用也越来越广,但目前几乎所有的NoSQL产品在运维上都没法和DB相提并论,在这篇blog中来总结下我们在运维hbase时的一些问题以及解决的方法,也希望得到更多h ...
- 禁止UINavigationController 左滑 返回的效果
在iOS7中,新增加了一个小小的功能,也就是这个:self.navigationController.interactivePopGestureRecognizer.enabled = YES;