Reputation:
I am using the Spark View engine with asp.net mvc3, gotta say I love spark bindings are awesome!
Everything works fine however development is extremely painful at the moment because any time I change any of my code I get Runtime Binder errors such as
The type or namespace name 'RuntimeBinder' does not exist in the namespace 'Microsoft.CSharp'
I am forced to clean and rebuild my solution and restart it and it works fine after that. Well at least until I make another code change and am then forced to do it again. Stopping IIS instance and starting project does not work I have to do full rebuild first.
I am running in Debug.
I have Rebooted,Checked Referenced DLL's, Cleared all files out off Tmp,Checked my web.config and spark file. I have added the following code in my global.asx file as explained here. Spark views work initially, but then get a "Dynamic view compilation failed" error after 30 minutes or so
private void PreLoadAssemblies()
{
// Deal with the compiling issue with Spark.
var initialAssemblies = AppDomain.CurrentDomain.GetAssemblies();
var di = new DirectoryInfo(Server.MapPath("~/bin"));
var files = di.GetFiles("*.dll");
foreach (var fi in files)
{
var found = false; //already loaded?
foreach (var asm in initialAssemblies)
{
var a = Assembly.ReflectionOnlyLoadFrom(fi.FullName);
if (asm.FullName == a.FullName)
found = true;
}
if (!found)
Assembly.LoadFrom(fi.FullName);
}
}
I guess this is not a crucial bug/problem and may not be worthy of stackoverflow users time as I can work around it but its bugging me more and more each day, and maybe someone has fix.
Upvotes: 1
Views: 354