I'm unable to install nuget pagckage
Microsoft.AspNet.Identity.Core.
When I run the install -package cmd I recieve the following message. It states I'm trying to install the package into a project with .NET 4 but the package 0doesn't reference that. Using VS2010 .NET v4
Thank you in advance.
Below is PM> Text:
PM> Install-Package Microsoft.AspNet.Identity.Core Installing
'Microsoft.AspNet.Identity.Core 2.1.0'. You are downloading
Microsoft.AspNet.Identity.Core from Microsoft, the license agreement
to which is available at
http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm.
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
'Microsoft.AspNet.Identity.Core 2.1.0'. Adding
'Microsoft.AspNet.Identity.Core 2.1.0' to PracticeMvcApplication.
Uninstalling 'Microsoft.AspNet.Identity.Core 2.1.0'. Successfully
uninstalled 'Microsoft.AspNet.Identity.Core 2.1.0'. Install failed.
Rolling back... Install-Package : Could not install package
'Microsoft.AspNet.Identity.Core 2.1.0'. You are trying to install this
package into a project that targets '.NETFramework,Version=v4.0', 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.
Andrew is correct, you can't install Identity on a project that targets .Net 4 or lower
Related
While installing the package Microsoft.EntityFrameworkCore.Tools for using EF in my project using Nuget, I'm persistently running into the below error. Notice I didn't get any error while installing other related packages used for EF core
Microsoft.EntityFrameworkCore
Microsoft.EntityFrameworkCore.Relational
Microsoft.EntityFrameworkCore.SqlServer
Here is the location of the file ef.exe
Basically the intention behind installing this package is to use EF command-line tools. I'm currently on Windows 10 and the .NET SDK installed on my machine is 3.1. I had previously 2 SDK's installed on my system(3.1 & 5.0). As per microsoft's documentaion, "The .NET CLI must choose an SDK version for every dotnet command. It uses the latest SDK installed on the machine by default." Therefore I went ahead and uninstalled .NET 5.0 SDK
Here are some of the solutions that I tried:
Deleting the package folder from '.nuget/packages/microsoft.entityframeworkcore.tools' & thereby the executable i.e. 'ef.exe' and reinstalling the same.
Installing the same package using dotnet cli.
Running Visual Studio 2019 as admin.
Deleted the folder "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions"
I have also tried some of the steps mentioned here on github: https://github.com/NuGet/Home/issues/1138
. Any kind of help would be really appreciated.
I have answered the detailed description of the solution here on microsoft's .NET Q&A platform.
'EntityFramework.Core.Tools' nuget package installation error
I am trying to install nuget package "Scandit" to my project.
IDE: Visual studio Mac(Xamarin.Forms 4.6.0.726)
The following is the error message.
Attempting to gather dependency information for package 'Scandit.BarcodePicker.Xamarin.5.14.5.10' with respect to project 'Modbusbutton3', targeting '.NETPortable,Version=v4.5,Profile=Profile78'
CACHE https://api.nuget.org/v3/registration5-gz-semver2/scandit.barcodepicker.xamarin/index.json
Total number of results gathered : 52
Gathering dependency information took 217.67 ms
Summary of time taken to gather dependencies per source :
https://api.nuget.org/v3/index.json - 5.27 ms
Attempting to resolve dependencies for package 'Scandit.BarcodePicker.Xamarin.5.14.5.10' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Scandit.BarcodePicker.Xamarin.5.14.5.10'
Resolved actions to install package 'Scandit.BarcodePicker.Xamarin.5.14.5.10'
Found package 'Scandit.BarcodePicker.Xamarin 5.14.5.10' in '/Users/dej.pvi/Downloads/20200506-WiFi Solution for iOS/packages'.
For adding package 'Scandit.BarcodePicker.Xamarin.5.14.5.10' to project 'Modbusbutton3' that targets 'portable45-net45+win8+wp8'.
Install failed. Rolling back...
Package 'Scandit.BarcodePicker.Xamarin.5.14.5.10' does not exist in project 'Modbusbutton3'
Executing nuget actions took 15.64 ms
Could not install package 'Scandit.BarcodePicker.Xamarin 5.14.5.10'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile78', 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.
Can any one help how to solve this? Thank you!
As I checked Scandit.BarcodePicker github sample they are using two different packages.
Scandit.BarcodePicker.Xamarin
This package is installed only in Android and iOS project.
Scandit.BarcodePicker.Unified
This package is installed in every project.
According to your log Target Framework of your project is PCL. You might consider to convert you project to .NETStandard 2.0, because this might be other issue why you are not able to install this package. Check the link here.
I am getting the following error while installing the lib.web.mvc.6.8.2 package with VS 2017. It seems there is an issue with the dependency Microsoft.AspNet.Mvc already installed:
PM> Install-Package Microsoft.AspNet.Mvc
Package 'Microsoft.AspNet.Mvc.5.2.3' already exists in project 'MyMVCApplication' Time Elapsed: 00:00:00.6708551
PM> Install-Package Lib.Web.Mvc -Version 6.8.2
Attempting to gather dependency information for package
'Lib.Web.Mvc.6.8.2' with respect to project 'MyMVCApplication',
targeting '.NETFramework,Version=v4.5.2'
Gathering dependency information took 8,86 sec
Attempting to resolve dependencies for package 'Lib.Web.Mvc.6.8.2'
with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Lib.Web.Mvc.6.8.2'
Resolved actions to install package 'Lib.Web.Mvc.6.8.2'
Retrieving package 'Lib.Web.Mvc 6.8.2' from 'nuget.org'. Install
failed. Rolling back...
Package 'Lib.Web.Mvc.6.8.2 : Microsoft.AspNet.Mvc [4.0.0, 6.0.0)' does not exist in project 'MyMVCApplication'
Package 'Lib.Web.Mvc.6.8.2 : Microsoft.AspNet.Mvc [4.0.0, 6.0.0)' does
not exist in folder 'C:\Users\Cyberphil83\documents\visual studio
2017\Projects\MyMVCApplication\packages'
Executing nuget actions took 19,84 ms Install-Package : Could not
install package 'Lib.Web.Mvc 6.8.2'. You are trying to install this
package into a project that targets '.NETFramework,Version=v4.5.2',
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.At line:1 char:1
+ Install-Package Lib.Web.Mvc -Version 6.8.2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
I checked the github of this project, and it looks like it is targeting .NET 4.6:
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
Lib.Web.Mvc.csproj
But your app is targeting 4.5.2.
So you have few options. One of them is to clone/fork this project and compile targeting 4.5.2. Or simply change your app to 4.6 (if possible?).
Since v6.8.0 release Lib.Web.Mvc requires .NET 4.6+ as it requires HTTP/2 support.
There is a v6.7.x branch which is fix-only branch supporting .NET 4.0+.
If you want to stick to .NET 4.5.2 you will have to use latest 6.7.x version:
PM> Install-Package Lib.Web.Mvc -Version 6.7.1
Alternative is to upgrade your project to .NET 4.6+.
In my Asp .Net Core Web Application (started with empty template) I cannot install Microsoft.AspNet.Mvc nuget package.
After pressing Install in Nuget manager I get this error message:
Package restore failed. Rolling back package changes for 'WebApplication1'.
I tried to solve it on my own, but:
1) My project doesn't have project.json
2) Clearing nuget cache like in this answer didn't help:
Netstandard1.x Nuget packages cannot be installed for netstandard1.x projects
Project target framework: .NetCoreApp1.0 (also tried 1.1)
Ide: VS2017 RC
I didn't have problems so far with installing other packages.
Is there a workaround to install mvc package?
Btw. I have to start with empty project template.
Thanks in advance for your support.
I looked harder in nuget package name and discovered that correct package to install should be Microsoft.AspNetCore.Mvc and not Microsoft.AspNet.Mvc.
Silly mistake, I chose most popular package by typing "mvc" in search box.
I was trying to install Nuget package for MonoDroid project (Visual Studio 2015):
Microsoft.AspNet.SignalR.Client
And I got this error:
Could not install package 'Microsoft.AspNet.SignalR.Client 2.2.0'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v4.3', but the package does not contain any assembly references or content files that are compatible with that framework.
Any idea to sort this out?