0

Im trying to use an ASP.NET web application downloaded from the internet. Im looking for a way restore all the dependencies/packages in a quick way (clean and building the project did not solve it), rather than installing them via nuget one by one. Is there anyway to download and install/resolve (version issues) all the necessary packages at once?

I tried below package manager console commands, but they did not resolve the package conflicts.

Update-Package -Reinstall, nuget install packages.config and other solutions here - How do I get NuGet to install/update all the packages in the packages.config?

[resolve/install packages]

enter image description here

Can someone help? Maybe Im using wrong commands or doing something wrong.

BUDDHIKA
  • 306
  • 2
  • 8
  • 23
  • 1
    Possible duplicate of [How do I get NuGet to install/update all the packages in the packages.config?](https://stackoverflow.com/questions/6876732/how-do-i-get-nuget-to-install-update-all-the-packages-in-the-packages-config) – krillgar Sep 01 '17 at 11:23
  • I tried the nuget commands available on that discussion, but they did not solved the issue. They, rolled back some of the package installations due to incompatibilities with each other. Just wanted to know, is there any quick way to get these packages installed? – BUDDHIKA Sep 01 '17 at 11:36
  • @BUDDHIKA,You should uninstall packages and re-install once – VIGNESH ARUNACHALAM Sep 01 '17 at 11:42

2 Answers2

1

If you go into Tools > Nuget Package Manager > Manage Nuget Packages for Solution, it will show a yellow bar at the top asking you if you want to restore missing packages. That's a manual way, but there are also some important VS options you want to look at as well, one being an option to restore packages on build.

There is a generic restore option as well from the package manager console, and that should have worked if it was simply a matter of reimporting the missing packages...

Update-Package -reinstall

You can try to delete the folders, than reinstall using these options. However, is there a possibility there is a .NET framework version mismatch with the version of the DLL's? Maybe some of the DLL's need updated?

Brian Mains
  • 50,520
  • 35
  • 148
  • 257
  • Thanks for this. When I used 'Update-Package -reinstall' it did not solve the issue, it gave errors when resolving DLL conflicts. As you said, there was a DLL version mismatch and it got sorted when I installed specific DLL version manually with appropriate nuget command. I found the DLL file version that I should install from the project upgarde report that visual studio provides when legacy applications are opened. – BUDDHIKA Sep 02 '17 at 15:31
0

Remove package folders from Package folder - don't remove package.config. Next, build you application - nuget should automatically restore all packages.