In this chapter, you learned how to install Entity Framework into your Project. In the next chapter, you will create your first demo project using Entity Framework 6. You must complete the next chapter because it is gonna to give you a whole view of Entity Framework in a single project. Next chapter is Overview of EF6 with New Database. I work on a closed system (no internet access). I have a non-development system with internet access. I need a copy of Entity Framework 6 for MVC 5. Where can get a copy?
Download Entity Framework Tools for Visual Studio 2012 for free. Entity Framework Tools for Visual Studio 2012 - The Entity Framework Tools provide additional design time tools in Visual Studio to help you develop using the Entity Framework. Useful design-time utilities for EF 6, accessible through the Visual Studio Solution Explorer context menu. When right-clicking on a file containing a derived DbContext class, the following context menu functions are supported: 1) View Entity Data Model (Read-only) 2) View En. The Microsoft Download Manager solves these potential problems. It gives you the ability to download multiple files at one time and download large files quickly and reliably. It also allows you to suspend active downloads and resume downloads that have failed. Microsoft Download Manager is free and available for download now. Entity Developer is a powerful modeling and code generation tool for ADO.NET Entity Framework v1 and v4 and LINQ to SQL. You can use Model-First and Database-First approaches to design your model and generate C# or Visual Basic.NET code for it.
Active3 years, 2 months ago
I installed EF 5.0 into the .DAL, now I want to install EF 5.0 into .BLL from Nuget
But the default online Nuget package always comes up with 6.0, which gives error when used together with the 5.0 EF I use in DAL.
Where can I install the 5.0 version of EntityFramework into my Nuget packages??
thenewseattle
thenewseattleEntity Framework 6.1.3 Download
thenewseattle1,10111 gold badge1010 silver badges1717 bronze badges
3 Answers
View -> Other windows -> Package Manager Console then run
install-package entityframework -version 5.0.0.0
.Latest Entity Framework Version
Add
-project <project.name>
if you want to install it in a specific project.devnulldevnull
here is what I experienced: (before I begin... kudos to devnull for the answer).
I clicked on:
1) View -> Other windows -> Package Manager Console then ran
2) install-package entityframework -version 5.0.0.0.
The uninstall started, but then rolled back, as it detected I already had installed Entity Framework (EF) 6.0.2 ...
>PM> install-package entityframework -version 5.0.0.0
Installing 'EntityFramework 5.0.0'. You are downloading EntityFramework from Microsoft, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkId=253898&clcid=0x409. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device. Successfully installed 'EntityFramework 5.0.0'. *****Install failed. Rolling back...***** install-package : Already referencing a newer version of 'EntityFramework'. At line:1 char:1 + install-package entityframework -version 5.0.0.0 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
So then I uninstalled the Entity Framework 6.0.2 and found it had a dependency that also needed to be removed... then I was finally able to uninstall the Entity Framework 6.0.2 and then add the Entity Framework 5.0.0.0
PM> uninstall-package entityframework -version 6.0.2 uninstall-package : Unable to uninstall 'EntityFramework 6.0.2' because 'AnotherFakeDbSet 3.0.0.0' depends on it.
So then I uninstalled these two and installed Entity Framework 5.0.0.0
![Ms entity framework download Ms entity framework download](/uploads/1/2/6/3/126383048/626246250.png)
PM> uninstall-package AnotherFakeDbSet -version 3.0.0.0
PM> uninstall-package entityframework -version 6.0.2
PM> install-package entityframework -version 5.0.0.0
I like the console... quicker than searching for the packages if you know the version #. And if you haven't checked out 'Powershell' (the basis for the console -- I find it's time well spent - it allows for virtually unlimited automation)
Dan BDan B
Older versions of Entity Framework or other similar packages can be installed using Package Manager Console only in earlier versions of Visual Studio (prior to 2015). In Visual Studio 2015 there is an option of manually selecting version before install but in Visual Studio 2010,2012 you need to use package manager console only.
Simple browse to the link Nuget Explorer and click on the specific entity version that you have to install.
You'll see that Studio automatically shows the Package Manager console code.
For example I was working on a project that required Entity Framework 4.1 So here was my code. Entity Framework Package Manager Console Command Snapshot
vibs2006vibs20063,47111 gold badge2626 silver badges2828 bronze badges
Not the answer you're looking for? Browse other questions tagged c#asp.netentity-framework-5entity-framework-6 or ask your own question.
-->Prerequisites
- EF Core is a .NET Standard 2.1 library. So EF Core requires a .NET implementation that supports .NET Standard 2.1 to run. EF Core can also be referenced by other .NET Standard 2.1 libraries.
- For example, you can use EF Core to develop apps that target .NET Core. Building .NET Core apps requires the .NET Core SDK. Optionally, you can also use a development environment like Visual Studio, Visual Studio for Mac, or Visual Studio Code. For more information, check Getting Started with .NET Core.
- You can use EF Core to develop applications on Windows using Visual Studio. The latest version of Visual Studio is recommended.
- EF Core can run on other .NET implementations like Xamarin and .NET Native. But in practice those implementations have runtime limitations that may affect how well EF Core works on your app. For more information, see .NET implementations supported by EF Core.
- Finally, different database providers may require specific database engine versions, .NET implementations, or operating systems. Make sure an EF Core database provider is available that supports the right environment for your application.
Get the Entity Framework Core runtime
To add EF Core to an application, install the NuGet package for the database provider you want to use.
If you're building an ASP.NET Core application, you don't need to install the in-memory and SQL Server providers. Those providers are included in current versions of ASP.NET Core, alongside the EF Core runtime.
To install or update NuGet packages, you can use the .NET Core command-line interface (CLI), the Visual Studio Package Manager Dialog, or the Visual Studio Package Manager Console.
.NET Core CLI
- Use the following .NET Core CLI command from the operating system's command line to install or update the EF Core SQL Server provider:
- You can indicate a specific version in the
dotnet add package
command, using the-v
modifier. For example, to install EF Core 2.2.0 packages, append-v 2.2.0
to the command.
For more information, see .NET command-line interface (CLI) tools.
Visual Studio NuGet Package Manager Dialog
- From the Visual Studio menu, select Project > Manage NuGet Packages
- Click on the Browse or the Updates tab
- To install or update the SQL Server provider, select the
Microsoft.EntityFrameworkCore.SqlServer
package, and confirm.
For more information, see NuGet Package Manager Dialog.
Visual Studio NuGet Package Manager Console
- From the Visual Studio menu, select Tools > NuGet Package Manager > Package Manager Console
- To install the SQL Server provider, run the following command in the Package Manager Console:
- To update the provider, use the
Update-Package
command. - To specify a specific version, use the
-Version
modifier. For example, to install EF Core 2.2.0 packages, append-Version 2.2.0
to the commands
For more information, see Package Manager Console.
Get the Entity Framework Core tools
You can install tools to carry out EF Core-related tasks in your project, like creating and applying database migrations, or creating an EF Core model based on an existing database.
Two sets of tools are available:
- The .NET Core command-line interface (CLI) tools can be used on Windows, Linux, or macOS. These commands begin with
dotnet ef
. - The Package Manager Console (PMC) tools run in Visual Studio on Windows. These commands start with a verb, for example
Add-Migration
,Update-Database
.
Although you can also use the
dotnet ef
commands from the Package Manager Console, it's recommended to use the Package Manager Console tools when you're using Visual Studio:- They automatically work with the current project selected in the PMC in Visual Studio, without requiring manually switching directories.
- They automatically open files generated by the commands in Visual Studio after the command is completed.
Get the .NET Core CLI tools
.NET Core CLI tools require the .NET Core SDK, mentioned earlier in Prerequisites.
The
dotnet ef
commands are included in current versions of the .NET Core SDK, but to enable the commands on a specific project, you have to install the Microsoft.EntityFrameworkCore.Design
package:For ASP.NET Core apps, this package is included automatically.
Important
Always use the version of the tools package that matches the major version of the runtime packages.
Get the Package Manager Console tools
To get the Package Manager Console tools for EF Core, install the
Microsoft.EntityFrameworkCore.Tools
package. For example, from Visual Studio:For ASP.NET Core apps, this package is included automatically.
Upgrading to the latest EF Core
- Any time we release a new version of EF Core, we also release a new version of the providers that are part of the EF Core project, like Microsoft.EntityFrameworkCore.SqlServer, Microsoft.EntityFrameworkCore.Sqlite, and Microsoft.EntityFrameworkCore.InMemory. You can just upgrade to the new version of the provider to get all the improvements.
- EF Core, together with the SQL Server and the in-memory providers are included in current versions of ASP.NET Core. To upgrade an existing ASP.NET Core application to a newer version of EF Core, always upgrade the version of ASP.NET Core.
- If you need to update an application that is using a third-party database provider, always check for an update of the provider that is compatible with the version of EF Core you want to use. For example, database providers for previous versions are not compatible with version 2.0 of the EF Core runtime.
- Third-party providers for EF Core usually don't release patch versions alongside the EF Core runtime. To upgrade an application that uses a third-party provider to a patch version of EF Core, you may need to add a direct reference to individual EF Core runtime components, such as Microsoft.EntityFrameworkCore, and Microsoft.EntityFrameworkCore.Relational.
- If you're upgrading an existing application to the latest version of EF Core, some references to older EF Core packages may need to be removed manually:
- Database provider design-time packages such as
Microsoft.EntityFrameworkCore.SqlServer.Design
are no longer required or supported from EF Core 2.0 and later, but aren't automatically removed when upgrading the other packages. - The .NET CLI tools are included in the .NET SDK since version 2.1, so the reference to that package can be removed from the project file: