https://mhusseini.wordpress.com/2015/02/05/ fix-visual-studio-2013-razor-cshtml-intellisense-in-class-library-or-console-application/
I tried to use A. cshtml file and the Razor syntax in a console application.
I was able to build the project, but the IntelliSense and the Error tab complaint about "
The name ' Model ' does not exist in the current context":
The usual fixes, like throwing in a web. config, didn ' t work. But then I found a fix to solve that problem. Here is the steps:
- Make sure you have the Microsoft asp . NET MVC NuGet package and its dependecies installed
- Clean and build your project, close your. Cshtml-files
- Copy the following DLLs from Debug (or the "mode") right to the Bin folder
- Microsoft.Web.Infrastructure.dll
- System.Web.Helpers.dll
- System.Web.Mvc.dll
- System.Web.Razor.dll
- System.Web.WebPages.Deployment.dll
- System.Web.WebPages.dll
- System.Web.WebPages.Razor.dll
Fix Visual Studio Razor CSHTML Intellisense in Class Library or Console application