Entity Framework Code First Migration Error

.net ef-code-first entity-framework exception-handling

Question

I'm new to MVC 4 and the entity framework, and when I use the package management console to perform the following command:

Enable-Migrations -ContextTypeName MyFirstMvcApp.Models.InventoryDbContext

Cannot bind argument to parameter "Path" since it is null in the Join-Path statement.

I encounter the following issue:

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At D:\GitProjects\MyFirstMvcApp\trunk\packages\EntityFramework.6.0.0-alpha2\tools\EntityFramework.psm1:363 char:27
+     $toolsPath = Join-Path <<<<  $installPath tools
    + CategoryInfo          : InvalidData: (:) [Join-Path], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At D:\GitProjects\MyFirstMvcApp\trunk\packages\EntityFramework.6.0.0-alpha2\tools\EntityFramework.psm1:392 char:73
+     $utilityAssembly = [System.Reflection.Assembly]::LoadFrom((Join-Path <<<<  $toolsPath EntityFramework.PowerShell.Utility.dll))
    + CategoryInfo          : InvalidData: (:) [Join-Path], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

You cannot call a method on a null-valued expression.
At D:\GitProjects\MyFirstMvcApp\trunk\packages\EntityFramework.6.0.0-alpha2\tools\EntityFramework.psm1:393 char:50
+     $dispatcher = $utilityAssembly.CreateInstance <<<< (
    + CategoryInfo          : InvalidOperation: (CreateInstance:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At D:\GitProjects\MyFirstMvcApp\trunk\packages\EntityFramework.6.0.0-alpha2\tools\EntityFramework.psm1:426 char:19
+         (Join-Path <<<<  $runner.ToolsPath EntityFramework.PowerShell.dll),
    + CategoryInfo          : InvalidData: (:) [Join-Path], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

How can this be fixed? Note that I have MVC4 installed in this link and that I am using Visual Studio 2010 Ultimate with SP1.

1
26
1/19/2013 4:07:52 AM

Accepted Answer

ZZZ_tmp
39
1/22/2013 3:37:47 AM

Popular Answer

Uninstall-Package in Visual Studio 2019 -Force EntityFramework

then

EntityFramework Install-Package -Pre -Version 6.2.0

There is a problem with v6.3.0.



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow