Running a custom VirtualPathProvider with a PreCompiled website

Posted by epilog on Stack Overflow See other posts from Stack Overflow or by epilog
Published on 2009-12-11T14:43:32Z Indexed on 2010/05/20 23:40 UTC
Read the original article Hit count: 522

Hi, currently I have a custom VirtualPathProvider in a Asp.net MVC web application.

This VirtualPathProvider checks the Area from the route "/{Area}/{Controller}/..." and uses the NameSpace.{Area}.Main.dll module to return the views that are contained in that assembly as Embedded Resources.

This works great and I don't have to deploy any ascx, js, css files.

Now my problem is this:

I would like to precompile the aspx and ascx files in the assembly and instead of having the views as embedded resources I would have the view class with all the Response.Write and dings and dongs.

I can precompile the views using the aspnet_compiler but I keep getting an error when ever the ViewEngine tries to find the view and fails.

My main goal is to have a way for the first time usage of a certain view/usercontrol would be faster and don't wait for the compilation to happen.

This is a requirement since the application could be grouped into plugins and this plugins be deployed into the Bin directory.

Any thoughts?

With best regards Carlos Sobrinho

© Stack Overflow or respective owner

Related posts about virtualpathprovider

Related posts about precompiled