No projects supported by NuGet in the solution

I needed to:

1) restart VS (or reload the project in question), open 'Manage Packages for Solution', change the package source, it seems to be the action of changing the source that is important. I was already set to 'All' but changed it to 'Nuget' and then back to 'All'. Without doing this I could not execute the next step.

2) Installed a package using the 'Manage Packages for Solution' UI. This was an important step without which the next step was not possible.

3) Able to install packages via the package manager console again.

For others searching this and similar issues it started for no reason I can see (was working and the stopped working) with this error:

install-package : The operation failed as details for project ClassLibrary1 could not be loaded.
At line:1 char:1
+ install-package autofac
+ ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Even in a newly created project the same result. After this error I would get the Operation failed No projects supported by NuGet in the solution error reported above.

Unloading project & reloading had no effect (https://github.com/NuGet/Home/issues/7216)

It was nothing to do with characters in the project path as reported here (https://developercommunity.visualstudio.com/content/problem/160750/nuget-bug-in-vs155.html)

After changing the package source things seem to be normal, but this is not a global solution.

I need to do this with every new project I create in new solutions or existing. Class libraries and console applications are affected but it seems the new projects created with the new Worker Service template are not affected.


https://github.com/NuGet/Home/issues/7216

Restarting after selecting "Manage Nuget Package for Solution" (Tools > Nuget Package Manager > Manage Nuget Package for Solution OR right-click context menu on the Solution in Solution Explorer > Manage Nuget Package for Solution), seems to clear this up.

Tags:

Nuget

Xaf