I have created default MVC6 (.net framework 4.6.1) project. It contains only ValuesController. Also in the same solution I have added Class Library (.net framework 4.6.1).
When I added reference of MVC6 project to class library I am not able to use any classes and namespaces.
Error CS0246 The type or namespace name 'mvc6test' could not be found (are you missing a using directive or an assembly reference?)
In your class library project, make sure that the required ASP.NET MVC nuget package is added, same way as your web project itself.
It will add the various missing assemblies in your class library project, like System.Web.Mvc, System.Web.Razor etc.
Note: Just wondering why you need to access this MVC project from within a class library. Normally it's the other way around.