Nustache View Engine ArrayTypeMismatchException

Trying to use Nustache to share mustache patterns between client and server, but Nustache just doesn't play well with my application. I used the code directly from my example MVC application in the source code, but I get an error every time I try to install or add a view mechanism. Here's a code snippet (from an action method, I also tried to add a view engine globally to global.asax and had the same error):

ViewResult viewResult = View(new { test = "Jawesome" });

viewResult.ViewEngineCollection = new ViewEngineCollection
                                  {
                                      new NustacheViewEngine()
                                  };

And here is the error:

[ArrayTypeMismatchException: Attempted to access an element as a type incompatible with the array.]
   System.Collections.Generic.List`1.Insert(Int32 index, T item) +62
   MyController.Index() in C:\src\projects\myproject\myproject.Web\Controllers\MyController.cs:83
   lambda_method(Closure , ControllerBase , Object[] ) +79
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +264
   ...
+5
source share
2 answers

MVC4 Nustache, . , , , , - .

, Nustache.Mvc3 System.Web System.Web.Mvc MVC3, , MVC4. : 1. Visual Studio Nustache.Mvc3 2. Applicaiton Target Framework .Net Framework 4.5 3. Solution Explorer, System.Web System.Web.Mvc Nustache.Mv3. 4. 4.0 System.Web System.Web.Mvc

+1

No longer a problem, now it's great. Excuse me!

-1
source

All Articles