Nuget.exe Install — Microsoft.CSharp already has a dependency for System.Dynamic.Runtime
Solution 1
The error message already has a dependency defined for
usually indicates that the version of NuGet you are using is too old. So you should look at updating it.
This particular error can happen when the NuGet packages being used are using a group dependency with a target framework which the version of NuGet you are using does not know about.
Solution 2
In my case, I get a message when install some Nuget Package:
'PackageA' already has a dependency defined for 'PackageB'
.
And I search PackageB in Nuget Package Manager online, and click install button to install it again, then ran into a problem:
The package requires NuGet client version '2.12' or above, but the current NuGet version is '2.7.40911.287'.
and I do as this solution Nuget version not correct?
after I upgrade the version of Nuget Package Manager, I can install PackageB, and then I can install PackageA.
Admin
Updated on July 20, 2022Comments
-
Admin almost 2 years
We install some packages via a PowerShell pre-build script in our CI build. Recently, we're been receiving Partially Successful email notifications with the following information provided:
'Microsoft.CSharp' already has a dependency defined for 'System.Dynamic.Runtime'
Here is the command from the PowerShell script that generates the information:
cd $source\MyNet\MyWeb\MyComp.WebViewer\packages &"C:\Program Files\Microsoft Team Foundation Server 14.0\Tools\Nuget.exe" install newtonsoft.json
I would like to be able to handle/ignore this message so that fully Successful build notifications are received.
It doesn't seem to be causing any problems otherwise.
Does anyone have any nuget.exe command line parameters that might bypass such an error?
-
Admin almost 8 yearsI'm trying to determine the latest version of Nuget.exe. I can't remember what I used to install it in the above mentioned location previously, but it looks like Team Foundation Server Tools. When I search for that, I see something that's dated 11/2015. I'd like to just get an updated nugget.exe in place to see if that solves the problem. The version I currently have in place is 2.8.60318.667.
-
Uwe Keim over 7 yearsWorked for me, too! Thanks a lot.