Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PagedList package installed, "missing assembly reference" error in controller

I am following the MVC tutorial, I installed PagedList package, and I cannot use the PagedList reference in the controller.

The type or namespace name 'PagedList' could not be found (are you missing a using directive or an assembly reference?).

like image 648
Tomek Avatar asked Dec 25 '22 19:12

Tomek


2 Answers

First sorry for my terrible English. In my case, I use the MVC5 in Visual Studio Community 2015 and I solved the problem this way:

First I delete the cache of Visual Studio and NuGet cache:

  • Visual studio - go to %LocalAppData% \Microsoft\WebsiteCache and delete all folder.
  • Nuget - here

After I use the package manager console to remove PagedList.MVC, then remove PagedList and then re-install them again like so:

  • uninstall-package PagedList.mvc
  • uninstall-package PagedList
  • install-package PagedList
  • install-package PagedList.mvc

I holpe that help

like image 177
Alex fraga belo Avatar answered Apr 06 '23 08:04

Alex fraga belo


Include

using PagedList;
using PagedList.Mvc;

in the pgm and run

like image 44
Sachu Avatar answered Apr 06 '23 08:04

Sachu