EF6 transitions stopped working on VS 2015 RC

I am using VS2015CTP now, I decided to upgrade it to VS2015 Community RC. For some unknown reason, migrations to my projects stopped working.

In Visual Studio 2015, I get the following message>

PM> update-database 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 G:\Projects\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 G:\Projects\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 G:\Projects\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:809 char:5 + $domain.CreateInstanceFrom( + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : PathTooLongException PM> 

If I open the solution in VS 2013 and run the above command, everything will work fine. This is some kind of mistake in VS, she lost a link to something? Is there a way to activate some more extensive log, I really don't feel like debugging EF.

thanks

Edit: I think this is due to the way Nuget is handled in Visual Studio 2015, it doesn't seem to look at nuget.config in the same way. I have all the packages for several solutions in one folder, for this I use nuget.config in the .nuget folder with:

 <config> <add key="repositoryPath" value="G:/Projects/packages" /> </config> 

for some reason, it seems that VS2015 does not handle this the same way as VS2013, because it is trying to load packages into folder packages in the solution folder.

+6
source share
4 answers

Changed the Entity Framework version from 6.1.3 to EF 6.1.2, and now it works.

https://github.com/aspnet/EntityFramework/issues/1950

+5
source

Another reason may be to use EF in two or more projects ( https://github.com/NuGet/Home/issues/528 )

Workaround: Commentary

 <package id="EntityFramework" version="6.1.3" targetFramework="net46" userInstalled="true" /> 

all of it is "package.config", leaving without comment only the project with which you want to work with Migrations.

+1
source

The problem is related to the presence of several projects that link to EF.

None of the existing answers worked for me. The only way I could solve it was to unload all projects that reference EF, except the one on which I was running Update-Database on.

+1
source

This is caused by a NuGet error.

See Enable Migration Error

Suggested workarounds:

Install an updated NuGet client that resolves this issue. https://nuget.codeplex.com/releases/view/615507

Download this fixed version of EntityFramework.psm1

EntityFramwework.psm1

Copy it to the \ EntityFramework.6.1.3 \ tools directory, restart Visual Studio and try again.

Unload other projects that reference the Entity Framework

So, the only uploaded project that references the Entity Framework is the one that contains your EF model

0
source

Source: https://habr.com/ru/post/986458/


All Articles