This error has perplexed me for the last few days and can find little to no information on Google regarding this. This started the other day when I was assigned a new laptop by work and I'm essentially running this on a clean install of Windows 7 x64 with VS2012 Update 1.
这个错误让我在过去的几天里感到困惑,并且几乎没有关于谷歌的信息。有一天,我开始按工作分配一台新的笔记本电脑,而我基本上是在安装了VS2012 Update 1的Windows 7 x64上运行它。
Whenever I start up a project using Entity Framework 5 or 6-alpha, this exception gets thrown to the package manager console:
每当我使用Entity Framework 5或6-alpha启动项目时,此异常都会被抛出到包管理器控制台:
New-Object : Cannot find an overload for "Version" and the argument count: "2".
At <project path>\packages\EntityFramework.5.0.0\tools\in
it.ps1:5 char:46
+ if ($PSVersionTable.PSVersion -ge (New-Object <<<< Version @( 3, 0 )))
+ CategoryInfo : InvalidOperation: (:) [New-Object], MethodException
+ FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
Test-ModuleManifest : Invalid Module Manifest path '<project path>
\packages\EntityFramework.5.0.0\tools\'. The path argument must resolve to a single file in the file system with a '
.psd1' extension. Please fix the path specification and try again.
At <project path>\packages\EntityFramework.5.0.0\tools\in
it.ps1:14 char:34
+ $thisModule = Test-ModuleManifest <<<< (Join-Path $toolsPath $thisModuleManifest)
+ CategoryInfo : InvalidArgument: (C:\Users\stephe...rk.5.0.0\tools\:String) [Test-ModuleManifest], InvalidOper
ationException
+ FullyQualifiedErrorId : Modules_InvalidModuleManifestPath,Microsoft.PowerShell.Commands.TestModuleManifestCommand
Import-Module : Cannot bind argument to parameter 'Name' because it is null.
At <project path>\packages\EntityFramework.5.0.0\tools\in
it.ps1:31 char:18
+ Import-Module <<<< $thisModule
+ CategoryInfo : InvalidData: (:) [Import-Module], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.ImportModuleComma
nd
I can get rid of this error by editing the package scripts manually, but that feels like it would be the wrong approach. There are also multiple instances of it checking the Powershell version in this manner so I'm suspecting it's something that's wrong with my computers's configuration.
我可以通过手动编辑包脚本来摆脱这个错误,但感觉这是错误的方法。还有多个实例以这种方式检查Powershell版本,所以我怀疑它是我的计算机配置错误的。
This is affecting multiple ASP.NET MVC 4 projects of mine targeting .NET 4.5. I can't run any Entity Framework commands such as Enable-Migrations or Update-Database as a result of this error. Any clues will be greatly appreciated.
这影响了我的.NET 4.5的多个ASP.NET MVC 4项目。由于此错误,我无法运行任何实体框架命令,例如Enable-Migrations或Update-Database。任何线索将不胜感激。
1 个解决方案
#1
2
I finally got it to work, it was as simple as upgrading to PowerShell 3.0. That kinda makes the version detection pointless, but hey, at least it works.
我终于开始工作了,就像升级到PowerShell 3.0一样简单。这有点使得版本检测毫无意义,但嘿,至少它是有效的。
#1
2
I finally got it to work, it was as simple as upgrading to PowerShell 3.0. That kinda makes the version detection pointless, but hey, at least it works.
我终于开始工作了,就像升级到PowerShell 3.0一样简单。这有点使得版本检测毫无意义,但嘿,至少它是有效的。