May 16, 2013 at 10:03 AM
Edited May 16, 2013 at 10:11 AM
I set my layout inside my .cshtml pages like this:
Layout = "~/Views/Shared/_LayoutMicroPedi.cshtml";
With the default RazorGeneratorMvcStart file this code is executed (to make sure _ViewStart works properly):
However this causes calls to
for every page that uses a Layout (no other virtualpaths seem to ever reach this method). The default setting for
is false so this means the following code is executed for every page with a layout.
return BuildManager.CreateInstanceFromVirtualPath(virtualPath, typeof(WebPageRenderingBase));
That seems to kind of defeat the whole caching mechanism.
I'm also pretty confused when I'm supposed to use
I'm not even using WebStart (or multiple DLLs) so I just removed this 'RegisterVirtualPathFactory' method.
Would be interested to hear somebody elses thoughts on this.