I am having a hard time describing the exact issue, but is appears to be \"just\" an IntelliSense problem that only shows in razor (.cshtml) views. Been looking at this for 2 da
A reply in the article Stephen Muecke commented with got me started in the right direction. The solution is a mix of probably my confusion of which config needs to be where, and what feels like a workaround to something...
Set the [Output Path] of your class library project to [bin/]. Mohammad Chehab mentions this in his (currently offline?) blog post which was referenced in this article: http://thetoeb.de/2014/01/05/enabling-mvc5-intellisense-in-a-classlibrary-project/
In your [ClassLibrary/Views] folder you should have a Web.config which includes the correct razor versions and namespaces. I just copied the contents of the Web.config from our working Web application project and added/changed some namespaces. Example below.
In your [ClassLibrary] root folder you should change the App.config so that it also contains the system.web section with the compilation setting. Example below.
After changing these to a clean, close the solution, delete the bin folders, open the solution and for me it finally all worked again. I do have a sporadic issue with System.Web.Mvc.xml being locked, perhaps a side effect of the output path change that MS did not foresee or something... Perhaps nothing to worry about.
Hope this helps some poor googling soul some day.
Project/Views/Web.config
Project/App.config