Installing EntityFramework 6.1.3

1

I am getting the following error when installing Entity Framework with Visual Studio 2015 Community Edition:

install-package EntityFramework Attempting to gather dependency information for package 'EntityFramework.6.1.3' with respect to project 'Vidly', targeting '.NETFramework,Version=v4.5.2' Attempting to resolve dependencies for package 'EntityFramework.6.1.3' with DependencyBehavior 'Lowest' Resolving actions to install package 'EntityFramework.6.1.3' Resolved actions to install package 'EntityFramework.6.1.3' Adding package 'EntityFramework.6.1.3' to folder '\Mac\Home\Documents\Visual Studio 2015\Projects\Vidly\packages' Added package 'EntityFramework.6.1.3' to folder '\Mac\Home\Documents\Visual Studio 2015\Projects\Vidly\packages' Added package 'EntityFramework.6.1.3' to 'packages.config' Executing script file '\\Mac\Home\Documents\Visual Studio 2015\Projects\Vidly\packages\EntityFramework.6.1.3\tools\init.ps1' Executing script file '\Mac\Home\Documents\Visual Studio 2015\Projects\Vidly\packages\EntityFramework.6.1.3\tools\install.ps1' Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file://\\Mac\Home\Documents\Visual Studio 2015\Projects\Vidly\packages\EntityFramework.6.1.3\tools\EntityF ramework.PowerShell.Utility.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)" At \\Mac\Home\Documents\Visual Studio 2015\Projects\Vidly\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\Documents\Visual Studio\2015\Projects\Vidly\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\Documents\Visual Studio 2015\Projects\Vidly\packages\EntityFramework.6.1.3\too ls\EntityFramework.PowerShell.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)" At \\Mac\Home\Documents\Visual Studio 2015\Projects\Vidly\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:809 char:31 + $domain.CreateInstanceFrom <<<< ( + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : DotNetMethodException Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file://\\Mac\Home\Documents\Visual Studio 2015\Projects\Vidly\packages\EntityFramework.6.1.3\tools\EntityF ramework.PowerShell.Utility.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)" At \\Mac\Home\Documents\Visual Studio 2015\Projects\Vidly\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\Documents\Visual Studio 2015\Projects\Vidly\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\Documents\Visual Studio 2015\Projects\Vidly\packages\EntityFramework.6.1.3\too ls\EntityFramework.PowerShell.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)" At \\Mac\Home\Documents\Visual Studio 2015\Projects\Vidly\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:809 char:31 + $domain.CreateInstanceFrom <<<< ( + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : DotNetMethodException

I have tried bricelam's solution here, but neither replacing the psm1 file nor copy-pasting the text works, and produces the following:

Import-Module : File \\Mac\Home\Documents\Visual Studio 2015\Projects\Vidly\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1 cannot be loaded. The file \Mac\Home\Documents\Visual St udio 2015\Projects\Vidly\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1 is not digitally signed. The script will not execute on the system. Please see "get-help about_signing" for more details.. At \\Mac\Home\Documents\Visual Studio 2015\Projects\Vidly\packages\EntityFramework.6.1.3\tools\init.ps1:8 char:14 + Import-Module <<<< (Join-Path $toolsPath EntityFramework.psd1) + CategoryInfo : NotSpecified: (:) [Import-Module], PSSecurityException + FullyQualifiedErrorId : RuntimeException,Microsoft.PowerShell.Commands.ImportModuleCommand

This is all in an effort to run enable-migrations, which, naturally, failed.

If it matters, I am running Windows 7 x64 using Parallels on a MacBook Pro.

EDIT Mark Sowul's answer below points to the fact that using a network share, a Parallel's feature, would cause this issue. I am unsure how to change the directory, however.

c#
entity-framework
visual-studio-2015
asked on Stack Overflow Jun 8, 2016 by user • edited Jun 8, 2016 by user

2 Answers

2

You're running against a network share (\\mac). Try running it against a local directory. As part of the nuget package installation, it is trying to run a powershell script. For security reasons, by default, remote scripts across the network will not be executed.

Note that stackoverflow is escaping the double-slash in the original post, and I had to put in four slashes to get it to show up properly here.

answered on Stack Overflow Jun 8, 2016 by Mark Sowul
1

The solution is to move my \Visual Studio 2015 folder with the \Projects subfolder. In my case I moved it to C:\, which cleared up all issues.

answered on Stack Overflow Jun 8, 2016 by user

User contributions licensed under CC BY-SA 3.0