After updating a simple MVC application I got this error in Visual Studio:
The type or namespace name ‘Mvc’ does not exist in the namespace ‘System.Web’ (are you missing an assembly reference?)
This can happen when you update your project to a different version of the .Net framework. You can now manually update or reinstall the package mentioned in the error message. Most likely this error will reappear with another package. Followed by yet another one.
A faster way is to open the package manager console and use this command:
Update-Package -safe -reinstall -IgnoreDependencies
This command reinstalls all packages at once, what also includes packages that are still working. This unnecessary work will still be done faster than when you manually reinstall only the no longer working packages.
Does this reinstall the same version or the latest version available now?
Hi Stesvis,
The option –reinstall installs the same version of the package (see https://docs.microsoft.com/en-us/nuget/consume-packages/reinstalling-and-updating-packages#using-update-package ). If you omit this option, Update-Package installs the newest version.
Regards,
Johnny