C# : Building or getting latest keeps adding entity 5 to packages while project has been upgraded to 6 - entity-framework

After having updated a project using Nuget to Entity 6.1.3., this project keeps adding a package for Entity 5.0.0. when Getting latest of that project or when building it.
I already looked with low-level search (fileseek) but can't find any reference anymore in that project to EF5.
Already uninstalled the Entity package and reinstalled, but same result.
What else can I do to compeltely remove any reference to EF5 ?

Problem is solved in the meantime : there was an unloaded! project in which the packages.config still referenced the 5.0.0 framework. I didn't know that an unloaded project was still held into account when building.

Related

Problem with Entity Framework 6 migrations

I have a problem with creating migration for Entity Framework 6 in code first approach. I already created migration, but later when I tried to create new, this was the errror:
Your target project 'Blog' doesn't reference EntityFramework. This
package is required for the Entity Framework Core Tools to work.
Ensure your target project is correct, install the package, and try
again.
I checked NuGet, EF6 is installed, alongside with these packages

Abp 5.0 Template Issue with EF on VS2017

everyone,
I downloaded the template with the following features
Abp 5.0.0.0
Asp.Net MVC 5.x
Web application with server rendered HTML; ASP.NET MVC & jQuery
Entity Framework
VS2017 Community as Development Environment
The problem lies in the Entity Framework or the version of Nuget
Running the Update-Database command from the Nuget console always returns the same error
Update-Database not recognized cmdlet
My Nuget Version is 4.9.3.5777
I tried both to clear nuget cache, restore solution packages, restart vs2017 and computer (Windows 7 Enterprise 64) without success
There is some issue on download packages?
There is some issue on download packages?
I think this issue stands that the EF package is not installed successfully in your current project.
1.Please check if you have yellow warnings in Solution Explorer like this issue. If there's any warning, resolve it or share it here and I'll check it for you.
2.I know you've cleaned the nuget cache, but see this, there's one copy of the EF package locates in your Solution folder's packages folder when you're in project that uses Packages.config format. So though you've cleaned the nuget cache in %userprofile%\.nuget\packages, your project is still using the old copy in solutionDirectory\packages folder.
Suggestion(The order is important, please follow the steps one by one):
#1 For this, you should right-click your project=>Manage Nuget Packages(UI)=>Uninstall the EntityFramework package.(Or manually delete the EF package folder within SolutionDir\packages folder)
#2 Then clean the nuget cache by Tools=>Nuget Package Manager=>Package Manager Settings=>Clear All Nuget Cache.
#3 Close Package Manager Console if it's open. => Close VS instance.
#4 Then restart VS and reinstall that EF package by package manager UI. And manually open the Package Manager Console and type Update-Database to check if this issue goes away.
Hope it helps:)

Could not install package '--'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5'

I created this package, I need it in a project but couldn't install it, this error appears:
Could not install package 'Mshwf.NiceLinq 1.0.9'. You are trying to
install this package into a project that targets
'.NETFramework,Version=v4.5', but the package does not contain any
assembly references or content files that are compatible with that
framework. For more information, contact the package author
I don't know why this happen, in another project (Console) I changed the framework to 4.6 and other versions and it wasn't a problem, but this only happen in this project (MVC and Web API):
this is the nuspec file:
<?xml version="1.0"?>
<package >
<metadata>
<id>Mshwf.NiceLinq</id>
<version>1.0.9</version>
<title>Nice LINQ</title>
<authors>MShawaf</authors>
<owners>Mshawaf</owners>
<projectUrl>https://github.com/mshwf/NiceLinq</projectUrl>
<iconUrl>https://raw.githubusercontent.com/mshwf/NiceLinq/master/logo.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>See it as: WHERE ID IN (1, 2, 3, 7, 9, 22, 30, 101)</description>
<releaseNotes>Minor changes.</releaseNotes>
<copyright>Copyright 2016</copyright>
<tags>LINQ IEnumerable Where Contains Search Filter</tags>
</metadata>
</package>
Your package targets NETFramework,Version=v4.5.2. That means the assembly folder is lib\net452. You are trying to install the package to a higher framework (greater than 4.5) project. Create a project with framework 4.5.2 or rename the package's lib folder from net452 to the version which you want to target like net45 or net46.
You can target multiple framework too from a single package.
Edit your csproj file like this:
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
Refer here: https://learn.microsoft.com/en-us/nuget/create-packages/supporting-multiple-target-frameworks
For a complete, up-to-date list of target framework names, refer to https://learn.microsoft.com/en-us/nuget/reference/target-frameworks#supported-frameworks
Go to the folder:
C:\Users\[username]\.nuget\packages\[package name]\1.0.0.4\lib
Rename the folder with the .net version of your project.
Suppose I am using .net framework 4.6.1 my folder name should be net461
You can install earlier version like : Install-Package AutoMapper -Version 7.0.1
The .NET Target Framework version is most likely too old. I have VS 2017 and my default Target Framework for a new .NET Framework project was 4.0. I initially tried to install the RestSharp package but it failed with an almost identical message as in this post 'Could not install package ...' However, when I went to Project | Properties | and Application I was able to change the Target Framework to .NET Framework 4.6.1 and then it installed fine.
In my case, I was trying to install the package into a WPF App (.Net Framework) while my co-workers prepared the package for .Net Core Project.
Try creating a .Net Core Project(or the type of the targeted project type) and install the packages same way:
Solution Explorer>Right click to Solution>Manage Nuget Packages for solution>Search for the needed package>Install
Checking this before other solutions may save time.
In my case, I was trying to insert a package of our own making that we put into our own Nuget feed, so I had access to the project.
This is what I did to clear the issue up. In the project solution window, click on the packages.config. In the properties window, change build action to "Content." After pushing it out to our feed again I was able to install it into the main project.
I had similar issue which i fixed by removing the packages.config(you can edit the file if you don't want to remove) file and then made sure both the package i was using was built using the same .net version as the Project i was using it in(for me the package was built using 4.6 while my console project was targeting earlier version of .net).
Update the Application .NET target framework could solve the problem. In my case, I'm installing EmguCv 4.2 package. I get this same error when trying to build with 4.5.1 .NET target framework. After updated the .NET target framework to 4.6.2, I can install the EmguCv 4.2 Nuget package successfully.
Try installing .net SDK here and then right-click on your solution/project and "restore nuget packages"
I had this problem with a package I had created and hosted on our own private nuget server, but even after trying others suggestions here such as making sure that the package supported the correct .net framework version, it still wouldn't work.
I got someone else to try and they managed to add it with no problem.
Today, messing around in VS's options, I found a fix for this:
Options -> NuGet Package Manager -> General -> Clear All NuGet Cache(s)
How to clear nuget cache in visual studio
Hopefully this helps someone who was as confused as I was :D
In my case I tried to install Itext7 package my project .NET framework was 4.5
I changed my project .NET framework to .NET 4.6.1 by using the following steps then I installed the package successfully :
1- right click the project and click properties
2- Under application tab change the Target framework to the required framework for your package
I could not install OpenTK package in .NETFramwork app but i had success with .NET Core project
Check the supported version from "C:\Users \ [username] \.nuget\packages
[package name]\1.0.0.4\lib".
Go to Project > Right click and select Properties > Application > Target Framework
Change the Target Framework to the supported version
In my case supported version is net462 for the library

ADO.NET Entity Framework missing

I want to add Entity Framework to my project but for some reason the Item is missing. What do I do wrong? I´ve done this lika a 100 times before.
(I´ve tried by downloaded the nuget package, restarted my computer, created a new project and searched google.)
Try to go to Package Manager console and type:
install-package EntityFramework

NuGet not adding reference to dll in project

I have a solution with about 5 projects including a Silverlight client.
Through NuGet, I add the Async Targeting Pack for VS 11 at the solution level and select all projects.
It adds a reference in all the non-Silverlight projects, but not the SL one. The workaround is to add the reference by hand.
Is this a failure of NuGet? A failure of the NuGet package? Or am I doing something wrong?
Same thing occurs with Caliburn.Micro and the SL package.
Yet if I start from a fresh clean project, it all works as expected.
I tried deleting the .nuget and package folders, and manually removing the project reference, and that seemed to clear everything out, but I still had the above issues when adding the packages back in.
Greg
Which version of Silverlight are you using? I noticed the NuGet package only targets NET40, NET45 and SL5, so if you're using Silverlight 4, the reference won't be added to your SL4 projects.