Question

To be more specific, when a cshtml is needed, what happens? I would need to build an application with only ashx and a template engine, without the MVC stuffs, simple rendering, but i would'not like to loose the capability to change the cshtml files on the fly. So I have somehow to manage their recompilation, possibly without recycling the application server loading and unloading AppDomains.

On the first request I can build the page and load it in a sort of cache (like RazorEngine on codeplex), then reuse it. When the page changes i should change the page and that's it.

But as far as I understood a new assembly is built for every page, so if there are frequent changes (that is likely to happens in my environment) tons of assemblies will get loaded.

The question is,

How it works for the standard MVC ? CodeDom is used, or directly IL that is subsequently added without creating new assemblies?

One thing that comes me in mind now is that after building the assembly, it can be decompiled and then the IL loaded directly on the app, that would make sense

Ask for further clarification if it's unclear! (and any suggestion to this Stackoverflow newbie is welcome)

Was it helpful?

Solution

Ok, First the cshtml files are loaded then the files are compild into their own assemblies with the standard CSharp/VbCodeCompiler, no code dom is present as far as i understood...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top