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

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

问题描述

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


新对象:提供的值无效,或属性为
为只读。更改值,然后重试。在
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
property' PrivateBinPath'无法在此对象上找到。验证
属性是否存在并可以设置。在
D:\Projetos\Monitoramento\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:772
char:9
+ $ info.PrivateBinPath + ='; lib \\\
et45'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ b $ b + CategoryInfo:InvalidOperation:(:) [],RuntimeException
+ FullyQualifiedErrorId:PropertyNotFound异常用1参数调用LoadFrom:指定的路径,文件名或
两者都太长,全限定文件名必须小于260
个字符,目录名称必须小于248个字符。

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无法调用空值表达式的方法
D: \Projetos\Monitoramento\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:781
char:5
+ $ dispatcher = $ utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ b + CategoryInfo:InvalidOperation:(:) [],RuntimeException
+ FullyQualifiedErrorId:InvokeMethodOnNull异常用8参数调用CreateInstanceFrom参数:sp加密路径,文件
名称,或两者都太长。完全限定文件名必须少于
超过260个字符,目录名称必须小于248
个字符。在
D:\Projetos\Monitoramento\packages\ EntityFramework.6.1.3\tools\EntityFramework.psm1:809
char:5
+ $ domain.CreateInstanceFrom(
+ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
+ CategoryInfo:NotSpecified:(:) [],MethodInvocationException
+ FullyQualifiedErrorId:PathTooLongException


使用EntityFramework输出6.1.1:


使用1参数调用LoadFrom异常(s):指定的
路径,文件名或两者都太长,完全限定文件名
必须小于260个字符,目录名称必须少于
248个字符。在C:\Users\Hudson\Documents\Visual Studio
2015\Projects\WpfApplication4\packages\EntityFram ework.6.1.1\tools\EntityFramework.psm1:780
char:5
+ $ utilityAssembly = [System.Reflection.Assembly] :: LoadFrom((Join-Path $ ToolsP ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MethodInvocationException
+ FullyQualifiedErrorId:PathTooLongException无法调用空值表达式的方法。在
C:\Users\Hudson\Documents\Visual Studio
2015\Projects\WpfApplication4\packages\EntityFramework.6.1.1\tools\EntityFramework.psm1: 781
char:5
+ $ dispatcher = $ utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ with8参数:指定的路径,文件
名称或两者都太长,完全限定文件名必须少于
超过260个字符,目录名称必须为小于248
个字符。在C:\Users\Hudson\Documents\Visual Studio
2015\Projects\WpfApplication4\packages\EntityFramework6.1.1\tools \EntityFramework.psm1:809
char:5
+ $ domain.CreateInstanceFrom(
+ ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
+ CategoryInfo:NotSpecified其他解决方案: https://github.com/aspnet/EntityFramework/issues/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天全站免登陆