Enable-Migrations Not Working Because of the Windows on Mac
I am a Mac user but want to develop with C# via Visual Studio. Therefore, I have a Parallels account which is a programme for switching OS to the Windows while using it.
Firstly, let me introduce the error I am getting: (Trying to do it from the Package Manager Console inside of the NuGet Package Manager)
Cannot determine a valid start-up project. Using project
'CodeFirstNewDatabaseSample' instead. Your configuration file and
working directory may not be set as expected. Use the
-StartUpProjectName parameter to set one explicitly. Use the -Verbose switch for more information.
Exception calling "LoadFrom" with "1"
argument(s): "Could not load file or assembly
ntityFramework.PowerShell.Utility.dll' or one of its dependencies.
Operation is not supported. (Exception from HRESULT: 0x80131515)" At
+ $utilityAssembly = [System.Reflection.Assembly]::LoadFrom <<<< ((Join-Path $ToolsPath EntityFramework.PowerShell.Utility.dll))
+ CategoryInfo : NotSpecified: (:) , MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
You cannot call a method on a null-valued expression. At
+ $dispatcher = $utilityAssembly.CreateInstance <<<< (
+ CategoryInfo : InvalidOperation: (CreateInstance:String) , RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Exception calling "CreateInstanceFrom" with "8" argument(s): "Could
not load file or
I have the same configuration (OSX + Parallels) and had the same problem than you. When source code is on OSX shared folder EF Package Manager Console throws that message. And as your link states, the problem is not Mac+Parallels but having the code on a network location.
If you move the code to your VM's desktop, maybe it's still network location if Paralells is configured to share desktop between Mac and Windows. Just try some pure windows location, as C:\VsProjects
I ended up moving the code to Windows location, it worked much better for me, but if you want to keep the code on network folder just need to use -StartupProjectName and specify the executable project there explicitly.
Asked in February 2016Viewed 2,828 timesVoted 13Answered 1 times