EntityFrameWork version 6.1.3 installed but it still shows version 6.0.0 - visual-studio-2013

I have just started my journey in MVC and EntityFrameWork. I am following a tutorial. When I try to add using option "MVC 5 Controller with views, using Entity Framework" the Visual Studio gives me error,
"There was an error running selected code generator.
Exception has been thrown by the target of an invocation"
I have searched for this error and found different solutions for the same problem. I have tried few and I am now trying to upgrade the Entity FrameWork to version 6.1.3 through Nuget. When I remove the existing package 6.0.0 and install the new one and restart Visual Studio then it still is showing version 6.0.0 both in Web.config file and in the EntityFrameWork reference property window. I have tried to uninstall and install it various times but the result is same.
I have created just one Model and DBContext Class and apart from this whole project is empty. I am using Visual Studio 2013 Update 4.

Related

Upgrading from Entity Framework 6.2 to 6.3.0 in NuGet

Entity Framework 6.3.0 was published on 2019 Sep 23. I have two projects in my solution that were using 6.2 and I tried to upgrade to 6.3.0 via NuGet.
One project called DatabaseInterface has an output type of "class library". The other project outputs a "console application".
When I run the upgrade from NuGet the following error happens for the project that is the class library.
An error occurred while applying transformation to 'App.config' in
project 'DatabaseInterface' No element in the source document matches
'/configuration/configSections/section[#name='entityFramework']'
This project, called DatabaseInterface does not even have an App.config file so the error is referring to a file that does not exist. This project has a packages.config file.
Published problems with a similar error are related to web projects so they are probably not closely relevant to my problem. What is the solution to this problem?
Context: Visual Studio 2017 Community, Visual Studio 2019 Community, Windows 10
Uninstall 6.2 and then install 6.3. This seems to cause the automatic deletion of packages.config and there will be no error associated with App.config nor will there be the creation of that file. Subsequent builds do not seem to require the presence of packages.config.

How to fix the error - The target "_CopyBinDeployableAssemblies" does not exist in the project?

I am trying to build a project that was created with MVC 4.0. There were errors with 'AllowAnonymous' attribute, because the build server did not have MVC 4.0 installed. So, I started installing MVC 4.0, but the setup prompted me to install Visual Studio 10.0 SP1 first, so I installed VS 10.0 SP1 and then installed MVC 4.0. The errors related to 'AllowAnonymous' attribute went away after the next build. But now I am getting an error which says - The target "_CopyBinDeployableAssemblies" does not exist in the project.I have tried a couple of solutions found on stack overflow that suggested
Importing the project Microsoft.Application.Web.Targets and Microsoft.Web.Publishing.Targets.
Install/Repair using the exe at http://go.microsoft.com/fwlink/?LinkId=253458.
But nothing has worked so far.
Please help me.
I managed to resolve this error by adding an empty targets tag in the .csproj file for the project:
<Target Name="_CopyBinDeployableAssemblies"></Target>
Found this on stackoverflow itelf in the response to a similar question:
Why do I get the error "The target GatherAllFilesToPublish does not exist"?

Entity Framework not appearing in Add New Item list in Visual Studio 2017

I created a new MVC project in Visual Studio 2017. I wanted to add an EDMX file (I will be doing database-first) so right clicked on the project and selected Add|New Item.
However, I cannot find the Entity Framework components that were available in the previous versions of Visual Studio. Does anyone know where they went?
I had a similar issue today after i updated my VS to the latest 2017 version. I tried to open an .edmx file in VS2017 and it didn't show the designer view. So i realised i forgot to select Entity Framework tools during the installation:
Everything is back to normal :)
In .NET Framework-based projects, the Entity Framework 6 templates are still there. However, for .NET Core-based projects, I believe you're expected to use the dotnet ef commands. This includes a means of scaffolding a code-first DbContext from an existing database. See ASP.NET Core - Existing Database.
To verify this, I setup a demo project with the following structure:
The New Item/Data dialog for the .NET Framework project:
Note that there is also an EF POCO Generator template available in the Online templates section that may be of interest to you:
I know this is late, but I ran into the same exact issue. After reading some of the other answers, I realized I had created a .Net project with Standard library instead of the Framework library.
I faced this issue, while creating an MVC application on my latest installation of VS2017.
Failed:
Tried installing Entity Framework using Nuget package manager[Install-Package EntityFramework], but failed to show Ado.NET Entity data model
Success:
1. open programs under control panel and select Visual Studio 2017
2. select Change the installation
3. Select Modify installation
4. Select Individual components
5. If SQL server data tools already installed, deselect/uninstall this component and reinstall the same again.
6. uninstall and reinstall SQL Server Data tools
Note: with one component change, other components may also be deleted. You have to recheck while reinstalling

Using ADO.NET's Entity Framework with visual studio 2010 and NuGet - what's really happening

I'll need to use ADO.NET EF for my next project so I started a tutorial but ended up with installing Entity Framework while my Project was open through Project -> Manage NuGet Packages and then decided to walk through the tutorial using another project so I closed the current one and on the next day I created new Console Project for the needs of this tutorial. However when I tried to add using System.Data.Entity; to my Program.cs it didn't recognize the Entity so I had to install again Entity Framework from NuGet which seems kind of strange to me.
Is this how it should be - installing the Entity Framework for every project that will use it or I can install it once and then add it as reference where needed or something like that like many other packages in .NET?
No, you shouldn't need to install Entity Framework for each project. Did you try adding a reference to the missing DLL? To do this, right-click your project in Solution Explorer and select Add Reference from the menu. You should be able to select System.Data.Entity from the .NET tab:

how can i use Entity Framework 4.1 in Visual Studio 2012?

I have a web application on a web farm and i use .NET 4 and entity data model 4.1.
when i started working on this web application i used visual studio 2010, and today i have uninstalled it and installed new version (Visual Studio 2012).
Due to some reasons, i have deleted my ado.net entity data model to recreate it, but i
pay attention that visual studio 2012 use entity framework 5 not 4.1. I have updated it but in old model i can context constructor to change my connection string but in this new model have no constructor, is that true?
I have installed EF 4.1 but it doesn't works and I've added version 5 to my project.
Background info: my web application is on a shared host and i can not update it to EF 5.
How can i use entity framework 4.1 in visual studio 2012 ?
is that possible? if yes, how?
Remove Existing (Entity framework 5)
Remove the existing reference (to Entity framework 5) under the References section in your Project in Solution explorer.
Remove the corresponding entry from your packages.config file. If you open the packages.config file, you will see an xml structure and you will see an element with id EntityFramework with version attribute value as 5.0.0. Remove that line( that package element).
Add Again (Entity framework 4.1)
Now go to the package manager window(View->Other Windows -> Package Manager Console) and execute the following command there.
Install-Package EntityFramework -Version 4.1.10331.0
This will download EF 4.1 to your project and you will see the success message like below.
Reference : http://nuget.org/packages/EntityFramework/4.1.10331.0
Always keep in mind that there are a lot of improvements made in EF 5. So consider to consume all those as possible as you can.

Resources