Tôi đang cố gắng để biên dịch một file dao cạo với dòng nàyRazorEngine phân tích cú pháp ném Không thể biên dịch
RazorEngine.Razor.Parse("Hello world");
Nhưng nó chỉ ném
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."}
Và tài sản lỗi như sau:
[0] = {error CS2001: Source file 'C:\Windows\TEMP\vlu4zahf.0.cs' could not be found}
[1] = {warning CS2008: No source files specified}
Vì vậy, không có thông tin tốt.
Tôi đang chạy .NET 4.0 và Razor cơ 3.2.0.0
Cập nhật 1
tôi đã định vị được lỗi để dòng này trong RazorEngine
Tuple.Create(
compileResult.CompiledAssembly.GetType("CompiledRazorTemplates.Dynamic." + context.ClassName),
compileResult.CompiledAssembly);
Vui lòng kiểm tra http://stackoverflow.com/questions/6444277/using-razorengine-to-parse-razor -templates-concurrently – Amit
@AmitAgrawal Cảm ơn, nhưng bài viết về độ an toàn của luồng. Tôi hiện chỉ có một chuỗi hoạt động. –