I'm new to Nugets install and DotLiquid, and I'm getting the following error when installing DotLiquid with Nugets:
Install failed. Rolling back...
Install-Package : Could not install package 'DotLiquid 2.0.64'. 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.
At line:1 char:1
+ Install-Package DotLiquid
From here, it says DotLiquid does support .NET Framework 4.5, however I don't know how to "download the nuget package", as the download link from dotliquid only show packages more than 4 years old.
How to fix it?
PS. If I try Get-Package DotLiquid, I'll get this:
PM> Get-Package DotLiquid
No packages installed.
UPDATE:
I've just installed the up-to-date NuGet extension (and restarted my MS VS several times), but the problem remain the same. My current NuGet version:
Package Manager Console Host Version 2.12.0.817
Related
We have a solution with two projects (both version .net 4.6.2).
When installing a nuget package from our private Nuget Feed to either one of the projects, it works.
If we try to install the same package version into both projects, then package gets installed into one of them, and the other one gives error : "Error Could not install package 'OurInternalPackageName 1.0.1.5'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.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. ".
We tried installing nuget using 'Manage packages for solution' option, manage nuget packages for projects separately but the result is still the same.
Changing .NET framework versions does not help.
Clearing Nuget cache did not help as well.
The workaround we are using now: install package to one of the projects, and then install a lower version of a package to another project.
We tested this with 'Automapper' Nuget, tried to install into both projects and it worked (Same version got installed into both projects).
Any ideas would be appreciated.
i am installing nuget package strip.net but when installing it give me this error in visoul studio , i did not find any solution plz need your solution
Severity Code Description Project File Line Suppression State
Error Could not install package 'Stripe.net 39.27.0'. 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. 0
The problem is that the latest nuget package Stripe.net 39.27.0 does not support your old target framework version 4.5.2. It is designed by the nuget author.
First, see this of Stripe.net 39.27.0: The nuget package supports net framework >=4.6.1 and net standard>=2.0. Since your target framework is 4.5.2 and also net standard 2.0 does not support 4.5.2 but supports >=4.6.1,see this document, so you do not meet either of these conditions.
So the solution is to either downgrade your nuget package or upgrade the target framework version of your project.
Solution
1) downgrade your nuget package, try to install the nuget package Stripe.net 37.35.0 and it supports net framework 4.5.2.
2) upgrade your project's framework version. Right-click on your project-->Properties-->Application--> change Target Framework to 4.6.1. And then you can install the latest nuget package Stripe.net 39.27.0.
Usually I work on .NET 4.5, My colleague had .NET 4.6.2 installed on his machine, gave me Project for me to do changes.
In Nuget Console, following below error is displayed
'4.6.0-preview6.19303.8' is not a valid version string.
I am trying hard to Update Nuget Packages it shows me below error, what does it mean..
PM> Install-Package Microsoft.Owin.Host.SystemWeb -Version 4.1.0
Attempting to resolve dependency 'Owin (≥ 1.0.0)'.
Attempting to resolve dependency 'Microsoft.Owin (≥ 4.1.0)'.
Installing 'Microsoft.Owin 4.1.0'.
You are downloading Microsoft.Owin from Microsoft, the license agreement to which is available at https://raw.githubusercontent.com/aspnet/AspNetKatana/v4.0.1/LICENSE.txt. 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.Owin 4.1.0'.
Installing 'Microsoft.Owin.Host.SystemWeb 4.1.0'.
You are downloading Microsoft.Owin.Host.SystemWeb from Microsoft, the license agreement to which is available at https://raw.githubusercontent.com/aspnet/AspNetKatana/v4.0.1/LICENSE.txt. 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.Owin.Host.SystemWeb 4.1.0'.
Install failed. Rolling back...
Install-Package : '4.6.0-preview6.19303.8' is not a valid version string.
At line:1 char:1
+ Install-Package Microsoft.Owin.Host.SystemWeb -Version 4.1.0
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], ArgumentException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
Any help will be appreciated. Thank you :)
After Nuget Update, Got to know Nuget is up to date
PM> nuget update -self
Checking for updates from https://api.nuget.org/v3/index.json.
CACHE https://api.nuget.org/v3/registration5-gz-semver2/nuget.commandline/index.json
Currently running NuGet.exe 5.5.1.
NuGet.exe is up to date.
Update successful.
Looks like it's related to nuget version, as stated in the documentation:
NuGet 4.3.0+ supports SemVer 2.0.0, which supports pre-release numbers with dot notation, as in 1.0.1-build.23. Dot notation is not supported with NuGet versions before 4.3.0. You can use a form like 1.0.1-build23.
In your case, 4.6.0-preview6.19303.8 is a "pre-release numbers with dot notation" (the '.' between "preview6" and "19303").
You can check the nuget version you're using by typing nuget help in the Package Manager Console of Visual Studio, then update it with nuget update -self
Additionally, it appears that there is also limitation on the version of Visual Studio:
Certain semantics of SemVer v2.0.0 are not supported in older clients. NuGet considers a package version to be SemVer v2.0.0 specific if either of the following statements is true:
The pre-release label is dot-separated, for example, 1.0.0-alpha.1
and
If you upload a SemVer v2.0.0-specific package to nuget.org, the package is invisible to older clients and available to only the following NuGet clients:
NuGet 4.3.0+
Visual Studio 2017 version 15.3+
Visual Studio 2015 with NuGet VSIX v3.6.0
dotnet
dotnetcore.exe (.NET SDK 2.0.0+)
Trying to install the OpenIDConnect Nuget package to my project, which was targeting .NET Framework 4.5. That failed, with the error:
Could not install package
'Microsoft.AspNet.Authentication.OpenIdConnect 1.0.0-rc1-final'. 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.
So I look at the dependencies for the package, and see that "DNX 4.5.1" is listed:
Dependencies
DNX 4.5.1
Microsoft.AspNet.Authentication (>= 1.0.0-rc1-final)
Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 2.0.0-rc1-211161024)
DNXCore 5.0
Microsoft.AspNet.Authentication (>= 1.0.0-rc1-final)
Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 2.0.0-rc1-211161024)
System.Net.Http (>= 4.0.1-beta-23516)
... so I assumed that DNX is a useless abbreviation of ".NET" - who knows, maybe the field doesn't accept a '.' in the field, so they had to come up with something else. No worries, I'll just upgrade my project to .NET Framework 4.5.1 and try again.
... but that didn't work. I get the same error, but the error has the 4.5.1 version number.
I looked at the "install other frameworks" page and I don't see any "DNX" frameworks listed there.
What am I doing wrong?
What's with the "DNX" business?
How do I Install OpenIDConnect Nuget Package with Dependency on “DNX 4.5.1”
Just like Will said, this nuget package came out during the birth of .NET Core and you can also find this this nuget package is a just a pre-release version, microsoft has not officially released it. It has not been updated since 11/18/2015. Obviously,The NuGet team deprecated this package.
To resolve this issue, you can use the package Microsoft.AspNetCore.Authentication.OpenIdConnect instead of it.
Get it from: https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.OpenIdConnect/2.1.0-preview1-final
Hope this helps.
I tried to install Farsi.Library 2.7.0 through the NuGet Package Manager Console.
But following error occurs:
Install-Package : Could not install package 'Farsi.Library 2.7.0'. 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.
According to his blog entry all versions of this library beyond and including version 2.6 are based on .NET Framework 4.6 - somehow this fixes a few bugs with the persian calendar. This is why the installation fails for you.
Install version 2.5.1.5, the latest version of this library which is based on .NET Framework 2.0, to bypass this.
Or upgrade your project to .NET Framework 4.6 or later.
Install-Package Farsi.Library -Version 2.5.1.5