Search code examples
razorengine

RazorEngine and Visual Studio 2015 IntelliSense


This post is not about ASP.NET MVC.

I am using RazorEngine for template processing available here:

https://antaris.github.io/RazorEngine/

The documentation states that I can have IntelliSense if I follow the instructions below:

https://antaris.github.io/RazorEngine/IntellisenseAndResharper.html

However, VS shows the following error:

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

Also the following errors:

The type or namespace name 'Linq' does not exist in the namespace 'System'
The type or namespace name 'Helpers' does not exist in the namespace 'System.Web'
The type or namespace name 'WebPages' does not exist in the namespace 'System.Web'
The type or namespace name 'WebPages' does not exist in the namespace 'System.Web'
The type or namespace name 'WebPages' does not exist in the namespace 'System.Web'

Am I getting the errors because I am editing the .cshtml in a command line project where the instruction assumes I use the web project? That doesn't make sense since RazorEngine does not have any project type requirement.

How can I address the issue? How can I edit .cshtml files in a command line project with IntelliSense without all of the above errors?


Found the answer

RTFM

According to the web page:

Your project output path is set to bin\ instead of bin\Debug\ and bin\Release. another possible solution is to copy RazorEngine.dll and System.Web.Razor.dll to bin.

I am not deleting the post since it might help others.


Solution

  • Found the answer

    RTFM

    According to the web page:

    Your project output path is set to bin\ instead of bin\Debug\ and bin\Release. another possible solution is to copy RazorEngine.dll and System.Web.Razor.dll to bin.