I'm trying to use RazorEngine to render templates and my templates are in VB.NET. The documentation is thin (or wrong) about how to specify what language the template parser should use, and I can't figure out how to configure it to use VB.

Can anyone point me in the right direction on this?

有帮助吗?

解决方案

Have you tried specifying VB as the language in the razorEngine -> templateServices config section?

<razorEngine>
    <templateServices>
        <add name="myCustomTemplateService" language="VB" />
    </templateServices>
<razorEngine>

From the original CodePlex site - Using Configuration

See the section called Accessing configured template services

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top