Problems installing JObject - c#

I had tried to install JObject in visual studio (both 4.6 and 3.5), via the NUGet option, but I get an error message:
Error Could not install package 'JObject 1.0.0'. You are trying to
install this package into a project that targets
'.NETFramework,Version=v3.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.
How can I fix this problem?

The answer is in the error message. JObject 1.0.0 only targets .NET Core 2.0 which means that NuGet can't find a suitable version for you since you're targeting .NET 3.5/.NET 4.6. You will have to change your projects target framework to the appropriate .NET Core version.
Edit: Frauke is correct, only change to .NET Core if it's a really small project or if you know what you're doing.

Related

System.Data.SqlClient with .NET 4.0

How to install System.Data.SqlClient to a .NET 4.0 project? When trying to install nuget package is VS, getting error package does not contain any assembly references or content files that are compatible with that framework. Can I go to a earlier version than 4.8.2?
As mentioned in the comments above, the .net 4 framework includes System.Data.SqlClient, you only need to add a reference to your project.
From this document, you can know that the minimum version of the .net framework that Microsoft.Data.SqlClient depends on is .NETFramework 4.6.1.
For changing the version when downloading the package, you can select other versions in the Version drop-down box.

issue while installing Square nuget pacge in visual stdio

Error Could not install package 'Square 4.0.0'. 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 face this issue on version 4.5 , all version of square not installed on this version of website
If you check the page for that package over on nuget.org you'll see that it is built against .NET Standard 1.3. If you then check what .NET version that corresponds to over on Microsofts documentation for .NET Standard you'll also see that .NET Standard corresponds to .NET 4.6. So you can't install this package in a project that targets .NET 4.5.
Also, it is the same requirements for Square 8.1.0 so you should probably get that version instead of 4.0.0.

Cannot update Microsoft.Extensions.Logging to (2.0) Mono Develop 6.1.4

My packages in my project indicated there was a version update to 2.0 for:
Microsoft.Extensions.Logging
NETStandard.Library
Microsoft.NETCore.Platforms
The only one I cannot get to update is Microsoft.Extensions.Logging
The Error I get is this:
Package 'Microsoft.Extensions.Logging 2.0.0' does not exist in folder '/home/MyUser/UpdatedPon/pon/sbmanager/packages'
Could not install package 'Microsoft.Extensions.Logging 2.0.0'. 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 have been searching the internet the past few days looking for a solution, but I have not found one as of yet.
Has any one ran into this issue, I am running MonoDevelop 6.1.4
and my MONO version is 5.2.0.215.
Lastly this is a WebForms application.
The Microsoft.Extensions.Logging 2.0.0 NuGet packages has assemblies for .NET Standard 2.0.
A more recent version of NuGet is required for .NET Standard 2.0 to be recognised as a target framework. So you would need to use MonoDevelop 7.1 for this to work. Also your project would need to target .NET 4.6.1 to be able to install the NuGet package.
Alternatively you could try installing the older version Microsoft.Extensions.Logging 1.1.2 which contains .NET Standard 1.1 assemblies which should be recognised by MonoDevelop 6.1.

Farsi.Library 2.7.0 Fails to install

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

I have a .net 4.7 project but I can't add a reference to NetStandard 2.0

i have a project that is a .net 4.7. In the nuget manager, I install the .net standard 2.0 preview in this project, I can see the reference in the solution explorer, but I get an error that DateTime is definied in an assembly that is not referenced, that I have to add the reference to netstandard.dll.
I have added manually the reference to the netstandard.dll that I have in the package folder, but then I get the error that the System.boolean and other type are not definied.
So I would like to know how I could have a .net 4.7 project that use another project that is .net standard.
Thanks.
Until the automated tooling is shipped in an update to VS 2017 15.3 preview / .net core tooling 2.0.0 preview2, you need to include the NuGet package NETStandard.Library.NETFramework to get netstandard2.0 support in .NET Framework projects.

Categories