Skip to content

Serialization problem #267

@imperugo

Description

@imperugo

Hi folks,
I'm getting an error during RunCompilemethod.

For a reason that I don't know the lasted version or RazorEngine is trying to serialize a class used into my project. That class is not serializable for tha reason the app crashes.
The weird part is that the previous version of RazorEngine was working, so probably is something related to the new version.

Here the error message:

Type 'Owin.OwinRequestScopeContext' in assembly 'OwinRequestScopeContext, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.

and here the stack

at System.AppDomain.InternalCreateInstanceFromWithNoSecurity(String assemblyName, String typeName) at RazorEngine.Compilation.CrossAppDomainCleanUp..ctor(AppDomain toWatch, IPrinter printer) at RazorEngine.Compilation.CrossAppDomainCleanUp.CreateInitial() at System.Lazy`1.CreateValue() --- End of stack trace from previous location where exception was thrown --- at System.Lazy`1.get_Value() at RazorEngine.Compilation.CrossAppDomainCleanUp.RegisterCleanup(String item, Boolean throwOnDefault) at RazorEngine.Templating.DefaultCachingProvider.CacheTemplate(ICompiledTemplate template, ITemplateKey templateKey) at RazorEngine.Templating.RazorEngineService.CompileAndCacheInternal(ITemplateKey key, Type modelType) at RazorEngine.Templating.RazorEngineService.GetCompiledTemplate(ITemplateKey key, Type modelType, Boolean compileOnCacheMiss) at RazorEngine.Templating.RazorEngineService.GetTemplate(ITemplateKey key, Type modelType, Object model, DynamicViewBag viewbag) at RazorEngine.Templating.TemplateService.GetTemplate(String razorTemplate, Object model, String cacheName) at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName) at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName) at 

Any hint?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions