Installing Ext.NET via nuget error: 'Newtonsoft.Json' already has a dependency defined for 'Microsoft.CSharp' - visual-studio

I am trying to install Ext.NET on Visual Studio 2012 via Package Manager Console but I receive this error:
'Newtonsoft.Json' already has a dependency defined for
'Microsoft.CSharp'
Here is the full process:
Install-Package Ext.NET
Attempting to resolve dependency 'Ext.NET.Utilities (≥ 2.5.0)'.
Attempting to resolve dependency 'Transformer.NET (≥ 2.1.1)'.
Attempting to resolve dependency 'Newtonsoft.Json (≥ 10.0.2)'.
Install-Package : 'Newtonsoft.Json' already has a dependency defined for 'Microsoft.CSharp'.
At line:1 char:1
+ Install-Package Ext.NET
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
*Nuget version: 2.8.60318.667

What Matt Ward said is perfectly correct. You can notice that one dependency restriction for package Ext.NET is Newtonsoft.Json (>= 10.0.2):
There is a dependency restriction for .NETStandard 1.0 framework of Newtonsoft.Json: Microsoft.CSharp (>= 4.3.0), you can check it from Json.NET 10.0.2. However, NuGet not support the newer .NETStandard frameworks until NuGet 2.12, you can get this information from NuGet release note 2.12.
Full NetStandard and NetCoreApp support for VS2013.
We could not use NuGet 2.12 on the Visual Studio 2012, so to resolve this issue, you can update your Visual Studio 2012 to Visual Studio 2013 or manage that assembly Manually, but this will bring a lot of tasks.

Related

How can I use netstandard2 using .net Framework 4.5?

I'm trying to install the package WebSocketSharp.Standard but I getting installing error.
Install-Package : Could not install package 'WebSocketSharp.Standard 1.0.3'. 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 WebSocketSharp.Standard -Version 1.0.3
CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
I download the NuGet and extract and I check the library only the netstandard2.0
how can I use the package in my current project? Im using VS2013.
.Net standard 2.0 support works starting with .net framework 4.6.1, but you get a lot of system DLLs next to your app. So use .net 4.8 and not 4.6.x.
The minimum requirement to use .net standard libs is to use Visual Studio 2015 (with the update 3 + a special hotfix), but it is better to use VS2017 or 2019:
If you only need to consume .NET Standard 2.0 libraries in your
projects, you can also do that in Visual Studio 2015. However, you
need NuGet client 3.6 or higher installed.
So your VS2013 is too old.

Unable to Add System.ServiceModel Nuget Package in Xamarin Form PCL Project

I am trying to follow the official xamarin tutorial to make use of WCF Services from a Xamarin Form PCL project (URL /guides/cross-platform/application_fundamentals/web_services/walkthrough_working_with_WCF/ on Xamarin website)
However, at the time of referencing the System.ServiceModel nuget package, I get the following error and the package does NOT get installed:
Could not install package 'System.ServiceModel 1.0.0'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile7', 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 also tried profile 78 without luck (I removed Windows Phone 8.1 as explained here since there is no WCF support).
I tried different profiles for the PCL project as explained here, but without success.
Also, I tried using the Package Management Console and got similar error:
PM> Install-Package -Verbose
cmdlet Install-Package at command pipeline position 1
Supply values for the following parameters:
Id: System.ServiceModel
GET ... OK
Attempting to gather dependency information for package 'System.ServiceModel.1.0.0' with respect to project 'Mobile\MobileCashRegister', targeting '.NETPortable,Version=v4.5,Profile=Profile7'
Attempting to resolve dependencies for package 'System.ServiceModel.1.0.0' with DependencyBehavior 'Lowest'
Resolving actions to install package 'System.ServiceModel.1.0.0'
Resolved actions to install package 'System.ServiceModel.1.0.0'
Install failed. Rolling back...
Package 'System.ServiceModel.1.0.0' does not exist in project 'MobileCashRegister'
Package 'System.ServiceModel.1.0.0' does not exist in folder 'C:\dev\DevCuddlUpSolution\packages'
Install-Package : Could not install package 'System.ServiceModel 1.0.0'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile7', 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 -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
How can I know which profile needs to be selected for the System.ServiceModel nuget package to be installed successfully?
Please note I am using Visual Studio 2015 Professional and the latest available Xamarin.
System.ServiceModel 1.0.0 does not contain any assemblies in any lib folders. It just seems to contain NuGet.exe so you will not be able to use it.
It is also not an official Microsoft NuGet package.

How can I install an old version of a ReSharper plugin?

I'm using ReSharper 8.0 in Visual Studio 2010. ReSharper 8.0 uses a NuGet-based Extension Manager for plugin management, which makes it very easy to find and install plugins, but this Extension Manager will only offer up the latest version of any given plugin. It also keeps track of plugin updates, and offers to update plugins when a new version is available.
This is where my problem has arisen. A particular plugin I use (GoToWord) has been updated, and the latest version (0.9.3) appears not to work. I cannot work out any way to roll back to the previous good version (0.9.1.1), nor a way to install an older version once I've uninstalled it.
I've tried opening the regular NuGet package manager console (at Tools | Library Package Manager | Package Manager Console) and issuing this command:
Install-Package resharper.GoToWord -version 0.9.1.1
But this fails at the dependency resolution phase, presumably because ReSharper isn't known to the regular NuGet:
Attempting to resolve dependency 'ReSharper (≥ 8.0)'.
Install-Package : Unable to resolve dependency 'ReSharper (≥ 8.0)'.
At line:1 char:16
+ Install-Package <<<< resharper.GoToWord -version 0.9.1.1
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
Does the ReSharper Extension Manager version of NuGet have a console? Or is there some other way to install an old version of a plugin?
Sadly, we didn't implement support for installing older versions of a plugin. But you should be able fake it manually, by editing the packages.config file in the %APPDATA%\JetBrains\ReSharper\vAny folder and adding a line such as:
<package id="ReSharper.GoToWord" version="0.9.1.1" />
If you restart VS now, and go to the extension manager, you should get prompted that some extensions aren't installed, and clicking the package restore button should download and install the right version.
Have you reported the issue on the project's GitHub page? https://github.com/controlflow/resharper-gotoword/issues

Failed to add reference to 'Newtonsoft.Json'

I just installed Windows 8 on my PC and downloaded Microsoft Visual Studio Express 2012 for Windows 8. Updated and everything, and when I try to install anything thru Package Manager Console, I get following error:
PM> Install-Package Parse
Attempting to resolve dependency 'Newtonsoft.Json (≥ 4.5.9)'.
Successfully installed 'Newtonsoft.Json 4.5.11'.
Successfully installed 'parse 1.0.5'.
Successfully uninstalled 'Newtonsoft.Json 4.5.11'.
Install failed. Rolling back...
Install-Package : Failed to add reference to 'Newtonsoft.Json'.
At line:1 char:1
+ Install-Package Parse
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
Does anyone know how to fix this error?
Thanks, Jack
Check if you already have Newtonsoft.Json reference added in packages.config. If yes, delete Newtonsoft.Json entry and retry Install-Package.
Sometimes just removing it from packages.config might not be enough. I had to remove the Newtonsoft.Json directory from the packages-directory, after that installing worked.

ReactiveUI 4.2.1 NuGet package

I'm trying to add the ReactiveUI NuGet package to a new VS2012 C# WPF .NET 4.5 project, but the NuGet package manager reports a problem "unable to resolve dependency 'Microsoft.Bcl.Async.NotBeta'". Are the dependencies in the ReactiveUI NuGet package wrong, or has the Microsoft.Bcl.Async.NotBeta package been removed? I can successfully install Rx-Main, which apparently does not depend on this Async.NotBeta package.
Here is the exact error from the package manager console:
PM> install-package reactiveui
Attempting to resolve dependency 'reactiveui-core (= 4.2.1)'.
Attempting to resolve dependency 'Rx-Main (= 2.0.21114)'.
Attempting to resolve dependency 'Rx-Interfaces (= 2.0.21114)'.
Attempting to resolve dependency 'Rx-Core (= 2.0.21114)'.
Attempting to resolve dependency 'Rx-Linq (= 2.0.21114)'.
Attempting to resolve dependency 'Rx-PlatformServices (= 2.0.21114)'.
Attempting to resolve dependency 'Microsoft.Bcl.Async.NotBeta (= 1.0)'.
install-package : Unable to resolve dependency 'Microsoft.Bcl.Async.NotBeta (= 1.0)'.
At line:1 char:1
+ install-package reactiveui
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
Upgrade to version 4.2.2, it has been fixed, see this Github issue
I had the same problem, try this.
1- Close VS2012
2- Remove your local packages folder
3- open VS2012
4- try to add the ReactiveUI to a specific project.
I moved my repository path to higher level share with the whole team.

Resources