Home Ask Login Register

Developers Planet

Your answer is one click away!

Kutay Demireren February 2016

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 'file://\Mac\Home\Desktop\Visual Studio 2015\Projects\CodeFirstNewDatabaseSample\packages\EntityFramework.6.1.3\tools\E ntityFramework.PowerShell.Utility.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)" At \Mac\Home\Desktop\Visual Studio 2015\Projects\CodeFirstNewDatabaseSample\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:780 char:62 + $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 \Mac\Home\Desktop\Visual Studio 2015\Projects\CodeFirstNewDatabaseSample\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:781 char:50 + $dispatcher = $utilityAssembly.CreateInstance <<<< ( + CategoryInfo : InvalidOperation: (CreateInstance:String) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull

Exception calling "CreateInstanceFrom" with "8" argument(s): "Could not load file or assembly 'file://\Mac\Home\De


tede24 February 2016

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.

Post Status

Asked in February 2016
Viewed 2,828 times
Voted 13
Answered 1 times


Leave an answer

Quote of the day: live life