Errors while compiling a Template.
Please try the following to solve the situation:
* If the problem is about missing/invalid references or multiple defines either try to load
the missing references manually (in the compiling appdomain!) or
Specify your references manually by providing your own IReferenceResolver implementation.
See https://antaris.github.io/RazorEngine/ReferenceResolver.html for details.
Currently all references have to be available as files!
* If you get 'class' does not contain a definition for 'member':
try another modelType (for example 'null' to make the model dynamic).
NOTE: You CANNOT use typeof(dynamic) to make the model dynamic!
Or try to use static instead of anonymous/dynamic types.
More details about the error:
- error: (0, 0) Unexpected fatal error -- 'de1_a63ad001\System.Net.Http.Formatting.dll'
Temporary files of the compilation can be found in (please delete the folder): C:\Windows\TEMP\RazorEngine_r1l0qtrf.ktk
The template we tried to compile is:
------------- START -----------
@AddMetaData("resourcepath","/Portals/0/NBrightMod/Themes/FAQ/resx") @AddMetaData("resourcepath","/DesktopModules/NBright/NBrightMod/Themes/FAQ/resx") @AddMetaData("resourcepath","/DesktopModules/NBright/NBrightMod/App_LocalResources") @inherits NBrightMod.render.NBrightModRazorTokens
@using NBrightDNN
@AddMetaData("resourcepath", "/DesktopModules/NBright/NBrightMod/Themes/FAQ/resx/")
@AddMetaData("resourcepath", "/DesktopModules/NBright/NBrightMod/App_LocalResources/")
@AddPreProcessMetaData("orderby", "ORDER BY NB1.XMLData.value('(genxml/hidden/sortrecordorder)[1]','int')", "FAQ.view.cshtml", Model.ModuleId.ToString(""))
@ResourceKey("View.faq")
------------- END -----------
The generated source code is:
------------- START -----------
//------------------------------------------------------------------------------
//
// Ce code a été généré par un outil.
// Version du runtime :4.0.30319.42000
//
// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
// le code est régénéré.
//
//------------------------------------------------------------------------------
namespace CompiledRazorTemplates.Dynamic {
using System;
using System.Collections.Generic;
using System.Linq;
using NBrightDNN;
[RazorEngine.Compilation.HasDynamicModelAttribute()]
public class RazorEngine_73d9e3526fac40b9b05517aaf3f49a5e : NBrightMod.render.NBrightModRazorTokens {
public RazorEngine_73d9e3526fac40b9b05517aaf3f49a5e() {
}
public override void Execute() {
WriteLiteral(" ");
Write(AddMetaData("resourcepath","/Portals/0/NBrightMod/Themes/FAQ/resx"));
WriteLiteral(" ");
Write(AddMetaData("resourcepath","/DesktopModules/NBright/NBrightMod/Themes/FAQ/resx"));
WriteLiteral(" ");
Write(AddMetaData("resourcepath","/DesktopModules/NBright/NBrightMod/App_LocalResources"));
WriteLiteral(" ");
WriteLiteral("\r\n");
Write(AddMetaData("resourcepath", "/DesktopModules/NBright/NBrightMod/Themes/FAQ/resx/"));
WriteLiteral("\r\n");
Write(AddMetaData("resourcepath", "/DesktopModules/NBright/NBrightMod/App_LocalResources/"));
WriteLiteral("\r\n");
Write(AddPreProcessMetaData("orderby", "ORDER BY NB1.XMLData.value('(genxml/hidden/sortrecordorder)[1]','int')", "FAQ.view.cshtml", Model.ModuleId.ToString("")));
WriteLiteral("\r\n\r\n");
Write(ResourceKey("View.faq"));
WriteLiteral("
\r\n\r\n\r\n\r\n");
foreach (NBrightInfo info in Model.List)
{
WriteLiteral("
\r\n");
WriteLiteral("
");
Write(HtmlOf(info, "genxml/lang/genxml/textbox/answer"));
WriteLiteral("
\r\n");
WriteLiteral("
\r\n");
}
WriteLiteral("\r\n