我嘗試編譯剃刀文件,該行RazorEngine解析拋出無法編譯
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和剃刀引擎3.2.0.0
更新1
我已經找到錯誤該線路RazorEngine
Tuple.Create(
compileResult.CompiledAssembly.GetType("CompiledRazorTemplates.Dynamic." + context.ClassName),
compileResult.CompiledAssembly);
請檢查http://stackoverflow.com/questions/6444277/using-razorengine-to-parse-razor:
這也可以在PowerShell中完成運行以下(以管理員身份運行) -templates-同時 – Amit 2013-04-04 08:37:11
@AmitAgrawal謝謝,但這篇文章是關於線程安全性的。我現在只有一個線程處於活動狀態。 – 2013-04-04 08:41:04