New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update-Database throwing "Could not load file or assembly EntityFramework .. or one of its dependencies" error #2592
Comments
Did you run package restore first? From that log it does look like it. Can you check all .config files for this? http://stackoverflow.com/questions/11749175/could-not-load-file-or-assembly-entityframework-after-downgrading-ef-5-0-0-0/11749176#11749176 |
No I haven't run the package restore. The log is different from the one mentioned in the stackoverflow link. I have also reproduced the same issue on a separate VM running on Azure with Windows 2012 RC + Visual Studio 2013. Not sure if its appropriate, but I can send that VM credentials to someone if they are interested to do any other diagnostics. |
Can you run package restore frst to make sure the assemblies are all downloaded and in place? |
I ran package restore but still same error. |
I also have the same error message when I am trying to deploy the database with the Update-Database statement. I am using a Windows 8.1 machine with Visual Studio 2013.5 (Ultimate). At the moment I am researching this problem and what I know is that this problem is EF 5.0.0 - Code First Migrations related and maybe has something to do with the Visual Studio 2013 update 5 package I installed this week. If I try the EF Code First Migration sample (https://msdn.microsoft.com/en-us/data/jj591621.aspx) with the EF 5.0.0 NuGet package I can create the initial database without problems. At the moment I use the Enable-Migrations command the same error message is raised which @ahmad-luqman reports. If I upgrade to EF 6.0.0 the Enable-Migrations command runs successfully. With this knowledge I created a fresh VM with Visual Studio 2013.4. I created again the sample with EF 5.0.0 and the Enable-Migrations command give no errors. Upgrading the NuGet plugin from 2.8.5 to the latest version (2.8.6) has no influence on the EF 5.0.0 behavior. My next goal is upgrading this VM to VS 2013.5 level and I think the error will return at that moment. I will report the results when I am finished with this test. |
I just finished my upgrade test from VS 2013.4 to VS2013.5. After upgrading to VS2013 update 5 you will get errors with EF 5.0.0 Code First Migrations. Below you can see the error message I get when I tried to enable migrations for the sample. It is similar to the error reported by @ahmad-luqman.
I opened a bug item at Microsoft Connect (https://connect.microsoft.com/VisualStudio/feedback/details/1593363) for this VS 2013 update 5 behavior. |
Yes. It worked once I downgraded VS2013 from Update 5 to Update 4. |
Not ideal, but you can use the following workaround:
We'll have to upgrade to the latest EF to support anything beyond VS2013.4. |
Migration of EF 5 to EF 6.1.x version for the gallery code was one of the options I tried. You will get errors when building the project after the NuGet upgrade because there is a breaking change in EF 6. I tried to solve them but it took me to much time so I stopped with this scenario. When I was updating the EF package I noticed that this solution uses a lot of old packages. More then 40 package updates where advertised and some of the updates are more than one year old. |
I believe the issue is that "Entity Framework 6.1.3 Tools for Visual Studio 2015" tooling is telling VS2015 to look for the EntityFramework.dll at:
Looking in
I ran the "Repair" option in Programs and Features on "Entity Framework 6.1.3 Tools for Visual Studio 2015", but the EF 5 bits still didn't show up in that location. SolutionAfter creating a "NuGet Packages" folder under C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\EFTools and dropping the unpacked EntityFramework.5.0.0 bits in it from the packages folder in the NuGetGallery solution, Update-Database was able to complete without error. Unfortunately, I have no idea where to file a bug or issue with the "Entity Framework 6.1.3 Tools for Visual Studio 2015" that ship with VS2015 RTM. |
I am still running into this same issue. I have tried to build with both VS 2013 as well as VS2015. What files did you copy under C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\EFTools ? |
The contents of the Entity Framework 5 nuget package. The entire
EntityFramework.5.0.0 folder structure. Note the "CodeBase" value in the
last code block of my previous post.
|
We're fixing this going towards EF6 - keep an eye on #2669 |
We're on EF6 now, GAC hack is no longer needed. Just a fresh clone / pull should do the trick. |
Excellent! |
Thanks to @adamskt your solution worked for me using VS2013 with update 5 installed on windows 10. |
I am trying to run the steps from https://github.com/NuGet/NuGetGallery/blob/master/README.md and when trying to run Update-Database call in Visual Studio 2013 Package Manager console getting the following errors:
I am currently running Windows 8.1 and have Visual Studio 2012, 2013 and 2015 installed. I have searched it over the internet but similar error (but not same error as the following seems to be different:EntityFramework.psm1:431 char:5
) solutions seems to be not solving this problem.
The text was updated successfully, but these errors were encountered: