Search code examples
visual-studionugetvisual-studio-2015

Visual Studio 2015 Nuget Error on non-MVC6 projects


I launched VS 2015 today to get some work done, and it says there's a nuget update so I updated it. after that, I created a new project to test something out and no nuget was installed. opened previous projects and tryied to install update whatever from nuget and all fails.

Mostly errors are project unavailable but I get failed to load dependencies and some other nuances while trying different stuff.

it fails everywhere and is unusable. How can I go back to prev version ? I don't even know which version was before and what gets installed now.

It does work on MVC6 projects.

System.Runtime.InteropServices.COMException (0x80004005): Project unavailable. ---> System.Runtime.InteropServices.COMException (0x80004005): Project unavailable.
   at EnvDTE.Project.get_Object()
   at NuGet.PackageManagement.VisualStudio.EnvDTEProjectUtility.GetReferences(Project project)
   at NuGet.PackageManagement.VisualStudio.EnvDTEProjectUtility.GetReferencedProjects(Project envDTEProject)
   at NuGet.PackageManagement.VisualStudio.VSSolutionManager.<>c__DisplayClass7.<GetDependentEnvDTEProjectsDictionary>b__6()
   at Microsoft.VisualStudio.Shell.InvokableAction.InvokeMethod()
   at Microsoft.VisualStudio.Shell.InvokableBase.Invoke()
   at NuGet.PackageManagement.NuGetPackageManager.<ExecuteNuGetProjectActionsAsync>d__d2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.PackageManagement.UI.UIActionEngine.<ExecuteActions>d__1b.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.PackageManagement.UI.UIActionEngine.<PerformAction>d__0.MoveNext()

Solution

  • I opened configuration, removed the v3 api endpoint and saved the settings and now it's all working again. I'm not sure if the update messed with the configuration somehow or it was a 'nuget server' issue that is fixed.

    Also packages.config is missing on new projects so I have to manually create it with this content :

    <?xml version="1.0" encoding="utf-8"?>
    <packages>
    </packages>
    

    In case it was the #1 I leave here what I did that fixed the problem.

    Open nuget configuration, disable v3 feed, save, and try again.