我正在尝试用这一行编译一个剃须刀文件
RazorEngine.Razor.Parse("Hello world");
但它只是抛出
base {System.Exception} = {"Unable to compile template. Source file 'C:\\Windows\\TEMP\\vlu4zahf.0.cs' could not be found\n\nOther compilation errors may have occurred. Check the Errors property for more information."}
错误属性如下所示:
[0] = {error CS2001: Source file 'C:\Windows\TEMP\vlu4zahf.0.cs' could not be found}
[1] = {warning CS2008: No source files specified}
所以没有好的信息。
我正在运行 .NET 4.0 和 Razor Engine 3.2.0.0
更新 1
我在 RazorEngine 中找到了这一行的错误
Tuple.Create(
compileResult.CompiledAssembly.GetType("CompiledRazorTemplates.Dynamic." + context.ClassName),
compileResult.CompiledAssembly);