Visual Studio 2015 RC Entity Framework 6.1.3 Migration Error

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

New object: invalid value or read-only property. Change the value and then try again. In 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 "PrivateBinPath" property could not be found on this object. Confirm this property exists and can be set. In D: \ Projetos \ Monitoramento \ packages \ EntityFramework.6.1.3 \ tools \ EntityFramework.psm1: 772 char: 9 + $ info.PrivateBinPath + = '; lib \ net45 '+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo: InvalidOperation: (:) [ ], RuntimeException + FullyQualifiedErrorId: PropertyNotFound Exception throws a "LoadFrom" with an argument of "1": "The specified path, file name, or both are too long. The full file name must be less than 260 characters and the directory name must be less than 248 characters." In 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 the method for the null value of the expression. In D: \ Projetos \ Monitoramento \ packages \ EntityFramework.6.1.3 \ Tools \ EntityFramework.psm1: 781 char: 5 + $ dispatcher = $ utilityAssembly.CreateInstance (+ ~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo: InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId: InvokeMethodOnNull Exception that raises "CreateInstanceFrom" with arguments "8": "The specified path, file name, or both are too long The full file name must be less than 260 characters and the directory name must be less than 248 characters D: \ Projetos \ Monitoramento \ packages \ EntityFramework.6.1.3 \ Tools \ EntityFramework.psm1: 809 char: 5 + $ domain.CreateInstanceFrom (+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo: NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId: PathTooLongException

Exit with EntityFramework 6.1.1:

Calling a LoadFrom exception with argument "1": "The specified path, file name, or both are too long. A fully qualified file name must be less than 260 characters and a directory name must be less than 248 characters." In the folder 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 the method for the null value of the expression In 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 that raises "CreateInstanceFrom" with arguments "8": "Y The path specified, the file name, or both are too long. The full file name must be less than 260 characters, and the directory name must be less than 248 characters. "In the folder 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

+13
c # migration visual-studio-2015 entity-framework-6
May 4 '15 at 12:44
source share
6 answers
+12
May 05 '15 at 8:29
source share

I have the same problem:(

My workaround:

  • Downgrade your Entity Framework to version 6.1 (at least the new NuGet GUI makes it very easy)
  • Run a command (e.g. Add-Migration ... ) in the package manager console. It seems to work in this version
  • Go back to Entity Framework v6.1.3
+1
May 04 '15 at 17:55
source share

This seems to be a common problem, but apparently a repo is difficult?

Inclusion-migration error # 1950

Invite you to add your problem data above, in the hope that they can be quickly resolved.

+1
May 05 '15 at
source share

According to yishaigalatzer 's comment on EF # 1950 bug, NuGet 3.0 RC2 is now released, which should fix this problem. Just download VSIX from codeplex and install it.

This solved the problem for me.

+1
Jul 10 '15 at 11:21
source share

I found a temporary solution: Comment on <package id="EntityFramework" version="6.1.3" targetFramework="net46" userInstalled="true" /> all of your "package.config", leaving only the project you want to comment on work with migrations.

The EntityFramework team ( https://github.com/aspnet/EntityFramework/issues/1950 ) and NuGet ( https://github.com/NuGet/Home/issues/528 ) are aware of the problem, and soon we will get a final solution.

0
May 05 '15 at 17:13
source share

In my case, I just:

1. Closed VS.
2. Removed the Entity Framework package from the package folder manually.
3. Open project and restored packages.

It worked for me.

0
May 23 '19 at 8:31
source share



All Articles