Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NuGet: 'X' already has a dependency defined for 'Y'

Tags:

asp.net

iis

nuget

I'm getting the following error in NuGet while trying to install package Microsoft.AspNet.Server.IIS

Attempting to resolve dependency 'Microsoft.AspNet.Loader.IIS.Interop (≥ 1.0.0-alpha4-10330)'. Attempting to resolve dependency 'Microsoft.AspNet.Loader.IIS (≥ 1.0.0-alpha4-10330)'. 'Microsoft.AspNet.Loader.IIS' already has a dependency defined for 'Microsoft.AspNet.FeatureModel'. 

How to resolve it?

UPDATE: Also, I'm getting the following:

Attempting to resolve dependency 'Microsoft.Framework.DependencyInjection (≥ 1.0.0-alpha4-10326)'. 'Microsoft.Framework.DependencyInjection' already has a dependency defined for 'Microsoft.Framework.ConfigurationModel'. 
like image 965
TN. Avatar asked Sep 08 '14 13:09

TN.


2 Answers

This was resolved by installing the latest NuGet Package Manager:

https://visualstudiogallery.msdn.microsoft.com/4ec1526c-4a8c-4a84-b702-b21a8f5293ca

Don't forget to restart Visual Studio.

like image 63
TN. Avatar answered Sep 17 '22 08:09

TN.


I fixed a similar issue in my solution by:

  1. Opening up a command prompt
  2. Navigating to the .nuget folder in my solution
  3. Running nuget update -self

This upgraded the copy of NuGet.exe that was in my solution from 2.8.0 to 3.4.4, which fixed the 'X' already has a dependency defined for 'Y' error that was stopping it from downloading SSH.NET automatically before building.

(If your solution doesn't have a copy of NuGet.exe in it - and it might not - then you should try the solution in TN's answer instead)

like image 30
Robyn Avatar answered Sep 17 '22 08:09

Robyn