Unable to Install Any Package in Visual Studio 2015

后端 未结 19 2315
太阳男子
太阳男子 2020-12-07 13:32

I\'ve tried every package I could possibly find and none of them will install in my project. I\'ve installed every update listed in the Extensions and Updates list that wer

相关标签:
19条回答
  • 2020-12-07 14:18

    In my case, This problem was caused by a mismatch in my Target framework setting under each project. When I created a new project, VS 2015 defaulted to 4.5.2, however all my nuget packages were built for 4.6.

    For some reason, VS 2015 was not showing me these errors. I didn't see them until I created a new empty project and tried to add my nuget project there. This behavior may have been aggravated because I had renamed the project a few times during the initial setup.

    I solved the problem by

    • changing the Target Framework on my projects to 4.6
    • closed VS 2015
    • deleted "packages", "obj" and "bin" folders
    • re-open the solution and try to add the nuget package again.
    0 讨论(0)
  • 2020-12-07 14:18

    I am using Visual Studio 2015 Update 3 and I managed to reproduce this error (despite Update 3 allegedly containing a fix).

    As suggested above, a reliable fix is to do the following... 1) Exit Visual Studio, 2) Delete the packages folder, 3) Restart VS.

    But... if you don't want to immediately exit VS for some reason, I was still able to add/remove packages from all projects by choosing the 'Manage NuGet Packages for Solution' option, rather than the individual Project with the issue.

    0 讨论(0)
  • 2020-12-07 14:19

    In general closing and re-open VS 2015 fixed most problems I have ran across. Once I did need to run a repair on one of my computers.

    However I was about to do this Closing and re-opening VS2015 resolved the issue for me I figured that I would instead right click on the project and Unload Project then right click and Reload project THEN Manage Nuget worked!

    0 讨论(0)
  • 2020-12-07 14:23

    In my case updating Microsoft.CodeDom.Providers.DotNetCompilerPlatform and Microsoft.Net.Compilers caused the problem.

    Deleting bin, obj, and packages folders and restarting Visual Studio 2015 solved the problem for me.

    0 讨论(0)
  • 2020-12-07 14:25

    My guess is Nuget Package Manager is messing up with VSO. I create a new project, add packages to it just fine, check in TFS. Then I go home, "Get Latest Version", and Run, and fail because Nuget Package Manager doesn't restore my packages. Solution: on my home machine

    1. open Nuget Package Manger, uninstall every packaged that have installed
    2. Open References folder, right click > Delete for all the packages you've installed
    3. Re-install them via Nuget Package Manager
    4. Check in
    0 讨论(0)
  • 2020-12-07 14:27

    Repairing Visual Studio 2015 seems to have resolved this issue for me. See this issue for NuGet in GitHub.

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