[英]Visual Studio 2015 RC Entity Framework 6.1.3 Migrations Error
仅当解决方案具有多个引用EntityFramework的项目时,才会出现粘贴的以下错误。 运行“启用 - 迁移”或“添加迁移”时,我收到以下错误:
New-Object:提供的值无效,或者属性是只读的。 更改值,然后重试。 在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在此对象上找不到属性“PrivateBinPath”。 验证该属性是否存在且可以设置。 在D:\\ Projetos \\ Monitoramento \\ packages \\ EntityFramework.6.1.3 \\ tools \\ EntityFramework.psm1:772 char:9 + $ info.PrivateBinPath + ='; lib \\ net45'+ ~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo:InvalidOperation :( :) [],RuntimeException + FullyQualifiedErrorId:PropertyNotFound使用“1”调用“LoadFrom”的异常“argument(s):”指定的路径,文件名或两者都太长。完全限定的文件名必须少于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你不能调用null值表达式的方法。在D:\\ Projetos \\ Monitoramento \\ packages \\ EntityFramework.6.1.3 \\ tools \\ EntityFramework.psm1:781 char:5 + $ dispatcher = $ utilityAssembly.CreateInstance(+ ~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo:InvalidOperation :( :) [ ],RuntimeException + FullyQualifiedErrorId:InvokeMethodOnNull使用“8”参数调用“CreateInstanceFrom”的异常:“指定的路径,文件名或两者都太长。完全限定的文件名必须少于260个字符,并且目录名称必须少于248个字符。“在D:\\ Projetos \\ Monitoramento \\ pac kages \\ EntityFramework.6.1.3 \\ tools \\ EntityFramework.psm1:809 char:5 + $ domain.CreateInstanceFrom(+ ~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~ + CategoryInfo:NotSpecified:(:) [],MethodInvocationException + FullyQualifiedErrorId:PathTooLongException
使用EntityFramework 6.1.1输出:
使用“1”参数调用“LoadFrom”的异常:“指定的路径,文件名或两者都太长。完全限定的文件名必须少于260个字符,目录名称必须少于248个字符“。 在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您无法在空值表达式上调用方法。在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使用“8”参数调用“CreateInstanceFrom”的异常:“指定的路径,文件名或两者都太长了。完全限定的文件名必须少于260个字符 d目录名称必须小于248个字符。“在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
我也有同样的问题 :(
我的解决方法是:
Add-Migration ...
)。 它似乎适用于此版本 根据yishaigalatzer关于EF bug#1950的评论,NuGet 3.0 RC2现已发布,应该可以解决这个问题。 只需从codeplex下载VSIX并安装即可。
这解决了我的问题。
就我而言,我只是:
1.封闭VS.
2.手动删除packages文件夹中的Entity Framework包。
3.打开项目并恢复包。
这对我有用。
我找到了一个临时解决方案:注释<package id="EntityFramework" version="6.1.3" targetFramework="net46" userInstalled="true" />
其所有“packages.config”只留下你想要工作的项目与迁移。
Team EntityFramework( https://github.com/aspnet/EntityFramework/issues/1950 )和NuGet( https://github.com/NuGet/Home/issues/528 )都知道这个问题,我们很快就会知道解决方案最终
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.