RazorEngine and Visual Studio 2015 IntelliSense

老子叫甜甜 提交于 2019-12-22 10:23:12

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/38773186/razorengine-and-visual-studio-2015-intellisense

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!