Enabling MVC5 intellisense in a ClassLibrary Project

This is still relevant, especially if you’re using RazorEngine. This also works for older versions of MVC as long as you have the version strings in the web.config set correctly.

thetoeb

I’ve been searching and searching the internet for someone, somewhere who might know how to enable correct IntelliSense for cshtml (MVC 5.0) in VS2013 when developing in a ClassLibrary type project.

This is the problem I was encountering:

Missing Intellisense

It’s all thanks to Mohammad Chehab, who was also stumped for a while (probably not as long as me), that I was able to find the solution.  His blog post explains that one must change the output path for the class library to bin/ (instead of bin/<release>)  for Intellisense  to work.

So now I can show you the steps for creating a ClassLibrary with cshtml (MVC5 Style):

  1. Create or open an existing class library project (if you open an existing one be sure to remove the MVC5 nuget package)
  2. Add the MVC (5.0) nuget package (right click project in solution explorer -> Manage NuGet Packages -> search for MVC and install “Microsoft…

View original post 463 more words