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

后端 未结 11 1006
终归单人心
终归单人心 2020-11-28 07:40

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

Attempting to resolve dependency \'Microso         


        
相关标签:
11条回答
  • 2020-11-28 08:32

    I faced this error on outdated version of Visual Studio 2010. Due to project configuration I was not able to update this version to newer. Therefore, update of NuGet advised above did not fix things for me.

    Root reason for the error in this and similar situations is in dependencies of the package you try to install, which are not compatible with .NET version available in your project.

    Universal solution is not obligatory update of Visual Studio or .NET but in installation of older NuGet versions of the same package compatible with your system.

    It is not possible to tell for sure, which of earlier versions will work. In my case, this command installed the package without any NuGet updates.

    Install-Package X -Version [compatible version number]
    
    0 讨论(0)
  • 2020-11-28 08:32

    In a project using vs 2010, I was only able to solve the problem by installing an older version of the package that I needed via Package Manager Console.

    This command worked:

    PM> Install-Package EPPlus -Version 4.5.3.1
    

    This command did not work:

    PM> Install-Package EPPlus -Version 4.5.3.2
    
    0 讨论(0)
  • 2020-11-28 08:35
    1. Go to Tools.
    2. Extensions and Updates.
    3. Update Nuget and any other important feature.
    4. Restart.

    Done.

    0 讨论(0)
  • 2020-11-28 08:36
    1. Go to the link https://www.nuget.org/packages/ClosedXML/0.64.0
    2. Search your NuGet packages
    3. See the all version of related packages
    4. Install the lower version of packages
    0 讨论(0)
  • 2020-11-28 08:37

    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.

    0 讨论(0)
提交回复
热议问题