gpt4 book ai didi

c# - 安装 EntityFramework 6.1.3

转载 作者:太空宇宙 更新时间:2023-11-03 23:14:33 29 4
gpt4 key购买 nike

在使用 Visual Studio 2015 Community Edition 安装 Entity Framework 时出现以下错误:

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

我试过bricelam的解决方案here , 但无论是替换 psm1 文件还是复制粘贴文本都不起作用,并产生以下内容:

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

这一切都是为了运行启用迁移,这自然会失败。

如果重要的话,我在 MacBook Pro 上使用 Parallels 运行 Windows 7 x64。

编辑Mark Sowul 在下面的回答指出了一个事实,即使用网络共享(Parallel 的一项功能)会导致此问题。但是,我不确定如何更改目录。

最佳答案

您正在针对网络共享 (\\mac) 运行。尝试针对本地目录运行它。作为 nuget 包安装的一部分,它正在尝试运行 powershell 脚本。出于安全原因,默认情况下,不会执行跨网络的远程脚本。

请注意,stackoverflow 正在转义原始帖子中的双斜线,我不得不输入四个斜线以使其在此处正确显示。

关于c# - 安装 EntityFramework 6.1.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37708671/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com