的Visual Studio 2015年RC实体框架6.1.3迁移错误 [英] Visual Studio 2015 RC Entity Framework 6.1.3 Migrations Error

查看:698
本文介绍了的Visual Studio 2015年RC实体框架6.1.3迁移错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下错误粘贴时,解决方案有多个项目引用的EntityFramework只发生。
当运行启用的迁移或添加迁移,我收到以下错误:




新对象:提供的值不是有​​效的,或者该属性是
只读。更改值,然后再试一次。在
D:\Projetos\Monitoramento\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:757
焦炭:13
+ $信息=新建 - 对象System.AppDomainSetup -Property @ {
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~
+ CategoryInfo:InvalidData:(:) [新对象],异常
+ FullyQualifiedErrorId:SetValueException,Microsoft.P​​owerShell.Commands.NewObjectCommand的
属性 PrivateBinPath'不能在该物体上找到。验证
的属性存在,可以设置。在
D:\Projetos\Monitoramento\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:772
焦炭:9
+ $ info.PrivateBinPath + ='; lib\\\
et45'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo:InvalidOperation:(:) [],RuntimeException的
+ FullyQualifiedErrorId:PropertyNotFound异常调用LoadFrom和1的说法(S):指定的路径,文件名或
两者都太长。完全合格的文件名必须小于260
字符,并且目录名必须少于248个字符。
。在
D:\Projetos\Monitoramento\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:780
焦炭:5
$ + utilityAssembly = [System.Reflection.Assembly] :: LoadFrom((联接路径$ ToolsP ...
+ ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~
+ CategoryInfo:NotSpecified:(:) [],MethodInvocationException
+ FullyQualifiedErrorId:PathTooLongException您不能调用一个空值表达式的方法在
D: \Projetos\Monitoramento\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:781
焦炭:5
+ $调度= $ utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo:InvalidOperation:(:) [],RuntimeException的
+ FullyQualifiedErrorId:InvokeMethodOnNull异常调用CreateInstanceFrom和8的说法(S):指定的路径,文件
名称,或者两者都太长。完整的文件名必须小于
超过260个字符,并且目录名必须少于248
字在
D:\Projetos\Monitoramento\packages\ EntityFramework.6.1.3\tools\EntityFramework.psm1:809
焦炭:5
+ $ domain.CreateInstanceFrom(
+ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
+ CategoryInfo:NotSpecified:(:) [],MethodInvocationException
+ FullyQualifiedErrorId:PathTooLongException




输出用的EntityFramework 6.1.1:




异常调用LoadFrom和1的说法(S):指定
路径,文件名,或者两者都太长完整的文件名
必须少于260个字符,并且目录名称必须是
以内。 248个字符在C:\Users\Hudson\Documents\Visual工作室
2015\Projects\WpfApplication4\packages\EntityFramework.6.1.1\tools\EntityFramework.psm1: 780
焦炭:5
+ $ utilityAssembly = [System.Reflection.Assembly] :: LoadFrom((联接路径$ ToolsP ...
+ ~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo:NotSpecified:(:) [],MethodInvocationException
+ FullyQualifiedErrorId:PathTooLongException不能调用方法在一个空值表达式。在
C:\Users\Hudson\Documents\Visual工作室
2015\Projects\WpfApplication4\packages\EntityFramework.6.1.1\tools\EntityFramework.psm1: 781
焦炭:5
+ $调度= $ utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo:InvalidOperation:(:) [],RuntimeException的
+ FullyQualifiedErrorId:InvokeMethodOnNull异常调用CreateInstanceFrom 和8的说法(S):指定的路径,文件
名称,或者两者都太长完全合格的文件名必须小于
超过260个字符,并且目录名称必须是不到248
字在C:\Users\Hudson\Documents\Visual工作室
2015\Projects\WpfApplication4\packages\EntityFramework.6.1.1\tools \EntityFramework.psm1:809
焦炭:5
+ $ domain.CreateInstanceFrom(
+ ~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
+ CategoryInfo:NotSpecified:(:) [],MethodInvocationException
+ FullyQualifiedErrorId:PathTooLongException



解决方案

其它解决方案: https://github.com/ ASPNET /的EntityFramework /问题/ 1950年#issuecomment-99164398



复制的 EntityFramework.psm1 这个补丁的版本


The pasted below error only occurs when the solution has more than one project that references the EntityFramework. When run the "Enable-Migrations" or "Add-Migration", I received the following error:

New-Object : The value supplied is not valid, or the property is read-only. Change the value, and then try again. At D:\Projetos\Monitoramento\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:757 char:13 + $info = New-Object System.AppDomainSetup -Property @{ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [New-Object], Exception + FullyQualifiedErrorId : SetValueException,Microsoft.PowerShell.Commands.NewObjectCommand The property 'PrivateBinPath' cannot be found on this object. Verify that the property exists and can be set. At D:\Projetos\Monitoramento\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:772 char:9 + $info.PrivateBinPath += ';lib\net45' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : PropertyNotFound Exception calling "LoadFrom" with "1" argument(s): "The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters." At D:\Projetos\Monitoramento\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:780 char:5 + $utilityAssembly = [System.Reflection.Assembly]::LoadFrom((Join-Path $ToolsP ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : PathTooLongException You cannot call a method on a null-valued expression. At D:\Projetos\Monitoramento\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:781 char:5 + $dispatcher = $utilityAssembly.CreateInstance( + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull Exception calling "CreateInstanceFrom" with "8" argument(s): "The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters." At D:\Projetos\Monitoramento\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:809 char:5 + $domain.CreateInstanceFrom( + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : PathTooLongException

Output with EntityFramework 6.1.1:

Exception calling "LoadFrom" with "1" argument(s): "The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters." At C:\Users\Hudson\Documents\Visual Studio 2015\Projects\WpfApplication4\packages\EntityFramework.6.1.1\tools\EntityFramework.psm1:780 char:5 + $utilityAssembly = [System.Reflection.Assembly]::LoadFrom((Join-Path $ToolsP ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : PathTooLongException You cannot call a method on a null-valued expression. At C:\Users\Hudson\Documents\Visual Studio 2015\Projects\WpfApplication4\packages\EntityFramework.6.1.1\tools\EntityFramework.psm1:781 char:5 + $dispatcher = $utilityAssembly.CreateInstance( + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull Exception calling "CreateInstanceFrom" with "8" argument(s): "The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters." At C:\Users\Hudson\Documents\Visual Studio 2015\Projects\WpfApplication4\packages\EntityFramework.6.1.1\tools\EntityFramework.psm1:809 char:5 + $domain.CreateInstanceFrom( + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : PathTooLongException

解决方案

Other solution: https://github.com/aspnet/EntityFramework/issues/1950#issuecomment-99164398

Copy this patched version of EntityFramework.psm1.

这篇关于的Visual Studio 2015年RC实体框架6.1.3迁移错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆