views:

43

answers:

2

Hello

I have a problem with Spark. I have compiled assembly with views, located in bin subfolder of website, that i created like below

engine.BatchCompilation(targetFolder, Global.AllKnownDescriptors());

On start of my app, a try to load compiled views:

svf.Engine.LoadBatchCompilation(Assembly.LoadFrom(Path.Combine(basePath, "SharedViews.dll")));

When debugging, i can see that this was successfull. But ViewEngine doesn't find that views. It even doesn'n look for them in CompiledViewHolder where they are located. May that problem be caused ny wrong IViewFolder? Or i should do something more to use compiled views? Thanks

A: 

Not sure if this is helpful, but in the documentation there's the following paragraph:

There is no dynamic recompilation of classes that are loaded in this way and changes to the spark files will have no effect. However the files must be available on disk at runtime. Sorry about that - but the different frameworks still needs to test for the view files' existence to know what view descriptor it should instantiate.

Do you have the view files in your directory structure?

R0MANARMY
A: 

I found out the solution - I compiled views not on app startup, but using different tool. So changes made to engine (registration of entries etc.) during compilation were vain. So now I compile view on app startup and everything ok.

Gopher
cann u share the code?
Quintin Par