RazorEngine icon indicating copy to clipboard operation
RazorEngine copied to clipboard

Load test (200 users, 10 minutes) generates exception on parsing

Open cohenomri opened this issue 14 years ago • 1 comments

Code: public override string Parse(string template, T data, string templateBaseName) { var templateBaseType = TemplateBaseService.GetTemplateBaseType(templateBaseName); var config = new TemplateServiceConfiguration { BaseTemplateType = templateBaseType }; string result; using (var service = new RazorEngine.Templating.TemplateService(config)) { try { result = service.Parse(template, data, null, null); } catch (Exception ex) { result = ex.Message; } } return result; }

this is the stack trace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames) at Microsoft.CSharp.CSharpCodeGenerator.FromDomBatch(CompilerParameters options, CodeCompileUnit[] ea) at Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromDomBatch(CompilerParameters options, CodeCompileUnit[] ea) at RazorEngine.Compilation.DirectCompilerServiceBase.Compile(TypeContext context) in C:\Users\Matt\RazorEngine\src\Core\RazorEngine.Core\Compilation\DirectCompilerServiceBase.cs:line 88

cohenomri avatar May 08 '12 15:05 cohenomri

You want to provide a cachekey so that you do not compile the template on every request?

matthid avatar Dec 30 '14 02:12 matthid