Razorengine 3.9 is used to run many templates. It creates assemblies with names like

CompiledRazorTemplates.Dynamic.RazorEngine_f06390a8eaeb403a8f8c121451f51dcf, Version=, Culture=neutral, PublicKeyToken=null

How to force it to create assemblies having meaningful names? It this case loaded assembly list can used to determine which assemblies are loaded. How to pass part of assembly name to RunCompile method to add this to assembly.

I tried to assing it to cache key using

var cachekey = "myreport " + FormsAuthentication.HashPasswordForStoringInConfigFile(razorSource, "MD5");
res = Engine.Razor.RunCompile(razorSource, cachekey, typeof(MyRazorViewModel),
                    new MyRazorViewModel());

but it does not appear in assembly name. It looks like cache key is not used to create assembly name.

ASP.NET MVC4 , .NET 4.6 / Mono, C#, Razor 3 are used.

Related posts

Recent Viewed