Created Issue: documentation on precompilation of views [4611]

1 view
Skip to first unread message

sparkviewengine Issue Tracker Rss Feed

unread,
Nov 7, 2009, 10:42:01 AM11/7/09
to spar...@googlegroups.com
In the page about precompilation, there is an example to load an assembly :

http://sparkviewengine.com/documentation/precompiling#Loadingadeployedprecompiledassembly

factory.Engine.LoadBatchCompilation(Assembly.Load("MyWebApp.Views.dll"));

It's not working but this is correct :

factory.Engine.LoadBatchCompilation(Assembly.Load("MyWebApp.Views")); //without dll because the method take the name of the assembly not the file

I didn't find the documentation in Git but If there's a way to correct/complete the page, I can fix the issue if I am correct !

And it's stated that the tricky part is to hold the instance of the ViewFactory. I do this in my "Start" method :

RegisterViewEngines(ViewEngines.Engines);

#if RELEASE
var vfactory = ViewEngines.Engines.FirstOrDefault(vf => vf is SparkViewFactory) as SparkViewFactory;
if (null != vfactory)
{
vfactory.Engine.LoadBatchCompilation(Assembly.Load("MyWebApp.Web.Views"));
}
#endif

Again if it's ok to add this as an example ?

Matthieu

URL: http://sparkviewengine.codeplex.com/WorkItem/View.aspx?WorkItemId=4611

Reply all
Reply to author
Forward
0 new messages