Currently I trying to separate my data model into a different project in the same solution, with code first. If I only have one project with EF( 6.1.3 ) installed, migration ( Enable-Migration
, Add-Migration
) work as intended.
But as I add an other project and install EF packet, if i try Enable-Migration
, I've got this error:
Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\projects\IMS 2\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:713 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 C:\projects\IMS 2\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:780 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 C:\projects\IMS 2\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:781 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 C:\projects\IMS 2\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:810 char:19
+ (Join-Path <<<< $runner.ToolsPath EntityFramework.PowerShell.dll),
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand
EF seems to work fine in both of the projects. Reinstalling EF to either or both of the projects did not solve it. Any solution in mind?
EDIT: I started a new solution with 3 projects, 1. for the basecontext( public class BaseContext<TContext> : DbContext where TContext : DbContext
... ), 2. for base classes, and 3. for creating a context based on base context and the classes. If i put ef in only one then migrtation works, or at least tells me thet it can't find a context, but if i install it into more then one, then it's producing the error again.
I found the same problem today and I had to uninstall the EF and install again.
PM> Uninstall-Package EntityFramework -Force
PM> Install-Package EntityFramework -Pre